Issue #2880361: Add core patch for correct checking if post_update is hook_post_update_NAME() or hook_update_N(). #2508
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.
Problem
As mentioned: https://www.drupal.org/project/drupal/issues/548470
We have found an issue with exactly this problem.
It has to do with the fact we have an install profile called
social
and a module calledsocial_post
This means any regular update hooks (f.e.
hook_update_N()
orhook_update_dependencies()
) used are considered as social module'shook_post_update_NAME()
. instead of social_post module'shook_update_%
The same can be done with the standard install profile for example, by creating a standard_post module or any other module with the module_post name.
Solution
For now we propose to at least fix this by adding some inspection in
DbUpdateController.php
to check if thehook_post_update_NAME
function is coming from the correct filemodule.post_update.php
This aligns with what is indicated when the post update hook can't be found.
For example in our case:
> [warning] Post update function social_post_update_8801 not found in file social.post_update.php
Issue tracker
In Open Social -
https://www.drupal.org/project/social/issues/2880361
In Drupal -
https://www.drupal.org/project/drupal/issues/3236316
How to test
update.php/selection
does not show anysocial_post
related update hooks.Release notes
Social post update hooks should now correctly not show up anymore when trying to update.