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

Node has Parent context does not explicitly check if the field exists. #1018

Closed
bibliophileaxe opened this issue May 9, 2024 · 0 comments
Closed

Comments

@bibliophileaxe
Copy link

bibliophileaxe commented May 9, 2024

What steps does it take to reproduce the issue?

  • Add a context condition that gets triggered on Node has Parent.

  • In Field that contains reference to parents select field_member_of

  • Create a new content type.

  • Add a content reference field with some other field name than field_member_of (field_node_reference, for example)

  • Add new content of this type.

  • Make sure the content reference field has a value.

  • This results in a WSOD.

What happens?
WSOD

What did you expect to happen?
The content gets created

Which version of Islandora are you using?
2.0

Fix

if ($entity->getEntityTypeID() == 'node' && $referenced_entity->getEntityTypeId() == 'node') {

Should check whether field exists.

Another small win:

if ($this->evaluateContextConditions($context, $provided) && !$context->disabled()) {

Disabled check should happen before the evaluation of context conditions.

Screenshots:
image
image

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

No branches or pull requests

2 participants