Problem/Motivation

domain.negotiator injection can return null upon first call, see https://www.drupal.org/project/domain/issues/3226427

Steps to reproduce

Do not have the time to reproduce, but arbirarily started to raise

Error: Call to a member function id() on null in domain_menus_menu_access() (line 372 of modules/contrib/domain_menus/domain_menus.module).

after creation of new menus. Menus are still accessible and usable through other forms, but this error always raises after calling their configuration forms, eg.

admin/structure/menu/manage/

Proposed resolution

A temporary patch is attached, but this issue needs general review for the domain module, see aforementioned issue.

Remaining tasks

Discuss other issue and fix generally. Find a way to reproduce.

Comments

medusa43 created an issue. See original summary.

  • drpldrp committed 5c2165b on 3.x authored by medusa43
    Issue #3262997 by medusa43: DomainNegotiator::getActiveDomain() unset in...
drpldrp’s picture

Status: Needs review » Fixed

I was unable to reproduce the error, but I have added the proposed solution anyways to 3.2.4 because there is nearly no downside to it.

medusa43’s picture

Status: Fixed » Needs review

Thanks for fixing that so fast!

willeaton’s picture

StatusFileSize
new1.36 KB

Sorry to reopen this case, as its something very similar it seems to make sense....

Error: Call to a member function id() on null in domain_menus_menu_link_content_access() (line 342 of modules/contrib/domain_menus/domain_menus.module).

We need the same thing in `domain_menus_menu_link_content_access`. I actually have the Domain patch installed as well, which does not fix this point (https://www.drupal.org/files/issues/2021-09-02/domain-prevent_null_activ...)

  • drpldrp committed 3a2ef2d on 3.x
    issue #3262997 - add fix to all calls for getActiveDomain() in...
drpldrp’s picture

Status: Needs review » Fixed
drpldrp’s picture

Status: Fixed » Closed (fixed)