Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I believe this hook should be removed for 2 reasons:
- Activating a feature calls feature rebuild anyways
- When installing the features through an installation profile, this can cause unexpected results, because the "menu" feature would be enabled and therefore rebuilt before the other features. So for example if you have one feature for contents (with your UUID entities) and another one for menu links with menu links pointing to this content, rebuilding menu links BEFORE rebuilding the UUID entities will cause issues.
I will propose a patch to solve this issue.
Comment | File | Size | Author |
---|---|---|---|
#3 | uuid-menu_links-1.patch | 15.23 KB | guillaumev |
#1 | 1596990-remove_features_enable-1.patch | 534 bytes | guillaumev |
Comments
Comment #1
guillaumev CreditAttribution: guillaumev commentedThe proposed patch solves the issue described
Comment #2
guillaumev CreditAttribution: guillaumev commentedThis patch does not make sense anymore now that menu links support was dropped in favor of http://drupal.org/project/entity_menu_links
Comment #3
guillaumev CreditAttribution: guillaumev commentedAdding this patch as for now I really need menu links support back in uuid...
Comment #4
pfrenssenWhat do you mean with the following?
I interpret this as "When a feature module is enabled
feature_rebuild()
is called", but that is not true. When a module is enabled,features_modules_enabled()
checks if it contains any features, and if this is the case it calls_features_restore('enabled')
which invokeshook_features_enable_feature()
.So
hook_features_enable_feature()
seems to be required to revert a feature on module enable.Comment #5
mgifford@guillaumev Can entity_menu_links() & menu_links()?? I'm assuming you want this to be brought back in so that others can also use menu_links...
Patch no longer applies: