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

Check if entity wrapper has property before trying to get it. #16

Open
wants to merge 1 commit into
base: 7.x-1.x
Choose a base branch
from
Open

Check if entity wrapper has property before trying to get it. #16

wants to merge 1 commit into from

Conversation

jfhovinne
Copy link
Contributor

Avoid fatal exception when the property does not exist, see:

$info = $this->getEntityWrapper()->getPropertyInfo($field_name);

$field_handler = $this->getFieldHandler($field_name, $language);
$field_handler->setDestinationField($mapping[$field_name]);
$field_handler->process();
if ($this->getEntityWrapper()->__isset($field_name)) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can move this check inside $this->getEntityWrapper()->getPropertyInfo($field_name); ? so that we can benefit of it wherever we use getPropertyInfo()?

@jfhovinne
Copy link
Contributor Author

Perhaps we need the exception returned by the parent in other cases?

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

Successfully merging this pull request may close these issues.

2 participants