check that the underlying entity has the parent reference field befor… #979
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…e trying to get() it
GitHub Issue: Islandora/documentation#2259
Release pull requests, etc.)
What does this Pull Request do?
It prevents a fatal error when trying to edit content which has an Entity Reference field and the site config uses any context which has a "Node parent" check. The code checks that the linked entities would have the parent reference field (field_member_of) before trying to get() that value. See issue 2259.
A brief description of what the intended result of the PR will be and/or what
problem it solves.
No fatal error when editing content (which is set up according to the Issue 2259).
What's new?
A in-depth description of the changes made by this PR. Technical details and
possible side effects.
I cannot imagine any side-effects. The code previously worked perfectly when an entity reference field was used on Repository Item content, but this merely will prevent this hook from causing a fatal error.
(i.e. Regeneration activity, etc.)?
How should this be tested?
(taken from issue 2259):
Documentation Status
This is a bug which happens only when adding a content type which has Entity Reference list field and an enabled Context which uses the "Node parent" condition. This does not need any documentation.
Additional Notes:
Any additional information that you think would be helpful when reviewing this
PR.
Interested parties
Tag (@ mention) interested parties or, if unsure, @Islandora/committers