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.
In #1270604: Can't access to new domain affiliated content a call to menu_rebuild()
was added to domain_save()
. This is very expensive and makes migrations very slow.
We can postpone the rebuild until the next page load by using variable_set('menu_rebuild_needed', TRUE);
instead. This is the same approach views module uses in views_invalidate_cache()
, paragraphs module uses in paragraphs_field_create_field()
and likely other modules too.
Comment | File | Size | Author |
---|---|---|---|
#3 | domain-3081432-3-defer-menu-rebuild.patch | 721 bytes | mstrelan |
Comments
Comment #2
mstrelan CreditAttribution: mstrelan commentedComment #3
mstrelan CreditAttribution: mstrelan commentedSorry, same as #2 but also applies to
domain_delete()
which speeds up migration rollbacks.Comment #4
agentrickardThis seems very reasonable.
Comment #6
agentrickardCommitted!