Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WorflowEntityValidator allow object #952

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

vytsci
Copy link

@vytsci vytsci commented Sep 23, 2019

If entity contains some object rather than entity and it goes to validator it throws not manageable error. We have lots of DataTypes in our code. This is just an unnecessary restriction.

If entity contains some object rather than entity and it goes to validator it throws not manageable error. We have lots of DataTypes in our code. This is just an unnecessary restriction.
@mbessolov
Copy link
Member

@vytsci Workflow engine in OroPlatform is built for transitioning entities through different steps of a workflow, and the entity restrictions are also for entities - https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/WorkflowBundle/Resources/doc/reference/workflow/configuration-reference.md#entity-restrictions-configuration

Why would there ever be a non-entity object?

@vytsci
Copy link
Author

vytsci commented Feb 16, 2020

Issue is that we have status as an object, but it can be managed as a string, and ORO thinks that if you have property and it is an object it must be an entity and it should not be like that. I understand that relations must be entities, but for example DateTime is also an object and if you add that to this equation it will also throw non configurable entity error.

$fieldValue = $this->doctrineHelper->getSingleEntityIdentifier($fieldValue);
$fieldValue = $this->doctrineHelper->isManageableEntity($fieldValue) ?
$this->doctrineHelper->getSingleEntityIdentifier($fieldValue) :
(string)$fieldValue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the related object doesn't implement the __toString() method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants