Problem/Motivation

On a site install using existing config I get this error message:

[error] Error: Call to a member function grantPermission() on null in lupus_decoupled_menu_install() (line 32 of /var/www/html/docroot/modules/contrib/lupus_decoupled/modules/lupus_decoupled_menu/lupus_decoupled_menu.install) #0 [internal function]: lupus_decoupled_menu_install(true)

Steps to reproduce

Run drush si --existing-config with a config that enabled lupus_decoupled_menu

Proposed resolution

Check if role exists in install hook

Remaining tasks

User interface changes

API changes

Data model changes

Command icon 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

arthur_lorenz created an issue. See original summary.

arthur_lorenz’s picture

Status: Active » Needs review
roderik’s picture

I don't know if I should set Needs Work, Needs more info or just test it myself (not sure about my allocated time anymore).

I guess I'll rely on an actual module maintainer to do whatever.

arthur_lorenz’s picture

but I'm kind-of weirded out by the notion that anonymous/authenticated roles would not exist

In the end both roles are just some config. If the config was not yet applied, the roles won't exist. But I should add the user module as dependency.

and a little afraid that now they won't get the "restful get rest_menu_item" permission assigned as they should.

don't be :) Usually this should only occur during site install with existing config. Then the permission should be applied in the config files and imported later on. Otherwise the roles should already exist. If not there might be a reason for it and it should not fail.

But I'm wondering if it makes more sense to check the `$is_syncing` and skip the step if it's true to not mess with any config.

roderik’s picture

Status: Needs review » Reviewed & tested by the community

Right. Thank you for clarifying :-) I should have kept $is_syncing in mind.

The explanation + the scope of the change (only when $is_syncing, which previously had an error) enables to RTBC after just reviewing code.

fago made their first commit to this issue’s fork.

  • fago committed a1a3166e on 1.x authored by arthur_lorenz
    Issue #3403787 by arthur_lorenz, roderik: lupus_decoupled_menu install...
fago’s picture

Status: Reviewed & tested by the community » Fixed

Merged, thank you!

Status: Fixed » Closed (fixed)

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