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

DGIR-44 : Update hook for cascading Entity Status #3

Merged
merged 6 commits into from
Nov 24, 2023

Conversation

Prashant-bd
Copy link
Contributor

No description provided.

@Prashant-bd Prashant-bd changed the base branch from main to DGIR-41 November 16, 2023 15:21
@Prashant-bd Prashant-bd changed the base branch from DGIR-41 to main November 16, 2023 15:21
*/
function islandora_entity_status_entity_update(EntityInterface $entity) {
// Check if the entity is a node with the bundle "islandora_object".
if ($entity->getEntityTypeId() == 'node' && $entity->bundle() == 'islandora_object') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of this check, check if entity has field IslandoraUtils::MEDIA_OF_FIELD

Copy link
Contributor Author

@Prashant-bd Prashant-bd Nov 22, 2023

Choose a reason for hiding this comment

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

We can not validate IslandoraUtils::MEDIA_OF_FIELD as its not present in islandora_object content type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Checking for MEMBER_OF_FIELD field.

/**
* Implements hook_entity_update().
*/
function islandora_entity_status_entity_update(EntityInterface $entity) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hook change from hook_entity_update to hook_ENTITY_TYPE_update

@bibliophileaxe bibliophileaxe merged commit ebbbfce into discoverygarden:main Nov 24, 2023
6 checks passed
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