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

Do not have a fatal error on a missing action #1014

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

AronNovak
Copy link

@AronNovak AronNovak commented Apr 24, 2024

#1015

What does this Pull Request do?

Makes PresetReaction more robust by not relying on the assumption that all actions are always available.

A brief description of what the intended result of the PR will be and/or what
problem it solves.

During using Islandora Drupal module inside https://github.com/Gizra/drupal-starter, we had a fatal error during the installation:

 [error]  Error: Call to a member function execute() on null in Drupal\islandora\PresetReaction\PresetReaction->execute() (line 59 of /var/www/html/web/modules/contrib/islandora/src/PresetReaction/PresetReaction.php) #0 /var/www/html/web/modules/contrib/islandora/src/IslandoraUtils.php(389): Drupal\islandora\PresetReaction\PresetReaction->execute(Object(Drupal\taxonomy\Entity\Term))

#1 /var/www/html/web/modules/contrib/islandora/islandora.module(226): Drupal\islandora\IslandoraUtils->executeTermReactions('\\Drupal\\islando...', Object(Drupal\taxonomy\Entity\Term))

#2 [internal function]: islandora_taxonomy_term_insert(Object(Drupal\taxonomy\Entity\Term))

#3 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(409): call_user_func_array(Object(Closure), Array)

What's new?

No new functionalities were added.

How should this be tested?

Intentionally creating a config that refers to a non-existing action would be sufficient.

Documentation Status

N/A

Interested parties

@Islandora/committers

@AronNovak AronNovak changed the title WIP: Do not have a fatal error on a missing action Do not have a fatal error on a missing action Apr 24, 2024
@AronNovak
Copy link
Author

AronNovak commented Apr 24, 2024

The failures are not related to this change:
image

Copy link
Member

@joecorall joecorall left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. This LGTM.

@joecorall joecorall merged commit c807695 into Islandora:2.x Apr 24, 2024
24 checks passed
@AronNovak AronNovak deleted the preset-reaction-robustness branch May 24, 2024 06:50
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