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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mstrelan created an issue. See original summary.

mstrelan’s picture

Status: Active » Needs review
FileSize
390 bytes
mstrelan’s picture

FileSize
721 bytes

Sorry, same as #2 but also applies to domain_delete() which speeds up migration rollbacks.

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community

This seems very reasonable.

  • agentrickard committed 5eefd4d on 7.x-3.x authored by mstrelan
    Issue #3081432 by mstrelan: Migrating domains is very slow due to menu...
agentrickard’s picture

Status: Reviewed & tested by the community » Fixed

Committed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.