Issue #3085176: move social_post_update hook to post_update #1529
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
The function social_post_update_8601 is being executed with every database update. Because the module is called social_post Drupal actually thinks its a hook_post_update. See: https://www.drupal.org/project/drupal/issues/2880361
Solution
It’s changing configuration, this should happen in a post_update hook and not an update hook. So moving it to social_post_post_update_8601_administer_post_permissions in social_post.post_update.php solves the issue for now.
Issue tracker
https://www.drupal.org/project/social/issues/3085176
How to test
Release notes
Due to naming conventions the social_post_update_8601 was being executed in every database update. We've moved the function to a post_update so it should only execute once.