Conversation
in the Reference.', $fieldDescription->getName())); | ||
throw new \LogicException(sprintf( | ||
'The field "%s" in class "%s" does not have a target model defined. ' . | ||
'Please specify the "target document" attribute in the mapping for this class.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
targetDocument
is the annotation/yml/xml attribute name, so it sould not have gotten a space here imho.
otherwise agree with the fix, exceptions need to tell as much context as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you suggest instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in a7d7820
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, the XML name is target-document
which is why I used the space ... I put targetDocument
in my mapping file and was debugging that for half an hour before realising the errpr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to validate the XML schema?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is targetDocument
in annotations. i guess we could try to formulate it a bit more agnostic ..
'Please specify a target document in the mapping for this class property.'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, sorry. so we should say it with a space then, and people who are confused can go look it up in the doc what it is in xml / annotations and get the right thing.
the xml schema validation i don't know. ah, that is not bundle configuration but the doctrine mappings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imho changing it from "the" to "a" makes it clearer that we are not naming the exact attribute one must set.
No description provided.