Problem/Motivation
I noticed this issue after the distribution we use was updated to Groups v2.
The problem is about the post update functions. 8.x-1.x had five update functions, which were removed in commit edf76f13fe:
group_post_update_group_type_group_content_type_dependencies()group_post_update_group_content_type_dependencies()group_post_update_grant_access_overview_permission()group_post_update_view_cache_contexts()group_post_update_make_group_revisionable()
Unfortunately, this removal wasn't registered properly, with a group_removed_post_updates() function. This means that every (new) Group installation will miss to register these post updates.
I believe this is not an issue in 99.9% of the cases, but I have a different situation. I am moving content between sites having the same structure, but one key requirement to this the sites have the same module schema versions / post updates / fields etc. And, this is why I noticed this issue.
Steps to reproduce
- Install a project with the latest Group 8.x-1.x tag
- Upgrade codebase and db schema to Group v2
- Notice that the post-update functions described in the above point have been registered
- Install a project with Group v2 (or v3, or v4 HEAD)
- Because there is no info about the (removed) post updates, nothing is registered.
The expected behavior is to have all the five functions being registered on install.
Proposed resolution
- 1. Put back the said post update functions (with empty body) into the next release of Group v2, Group v3 and maybe Group v4.
- 2. In Group v4, properly register the removed post update functions:
function group_removed_post_updates(): array { return [ 'group_post_update_group_type_group_content_type_dependencies' => '4.0.0', 'group_post_update_group_content_type_dependencies' => '4.0.0', 'group_post_update_grant_access_overview_permission' => '4.0.0', 'group_post_update_view_cache_contexts' => '4.0.0', 'group_post_update_make_group_revisionable' => '4.0.0', ]; }
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork group-3532775
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
kristiaanvandeneyndeGood catch, can definitely accommodate this.
Comment #3
huzooka@kristiaanvandeneynde Thank you!
If nobody picks this up I can start working on this tomorrow.
Comment #4
huzookaComment #7
kristiaanvandeneyndeComment #10
kristiaanvandeneyndeThey were removed before v2 was released, so I put the removal version at 2.0.0
Comment #12
kristiaanvandeneyndeHeads up, this will be reverted in #3620824: updb raises an error when upgrading from 3.3.5 to dev-3.3.x or to 4.0@alpha.
It's too fucked right now and it was only really needed in version 2. It was an oversight, as you correctly pointed out, but the fallout is not worth the technical correctness here for update hooks stemming from a version that is two weeks away from being EOL.
For your use case where you're adamant on having all versions report the same state, you can run the code currently in one of the tests in HEAD: