Wenn downloading the latest dev release and enabling it with drush en context on a multilingual site, I'll get the following error message:

Error: Call to a member function getPath() on null in /var/www/lakedrops/web/core/modules/config_translation/src/ConfigNamesMapper.php on line 233

This error gets thrown all the time, even if just flushing cache with drush. As soon as I disable the module again the error disappears. I wasn't able to look into that yet but would hope that someone may have an idea what could be causing this.

Comments

jurgenhaas created an issue. See original summary.

rutiolma’s picture

Version: 8.x-0.x-dev » 8.x-1.x-dev
Priority: Normal » Major

Same problem here.

znak’s picture

Assigned: Unassigned » znak
replicaobscura’s picture

Same error here.

I wonder if the issue is that Context's routes are all defined in the context_ui submodule, but config_translation is likely trying to determine one or more of the routes.

Just a hunch based on a similar issue I've seen before--I'm investigating this a bit more now.

replicaobscura’s picture

In ConfigNamesMapper.php, the getBaseRouteName() method should be getting the base route name for the entity type, and I believe it's unable to without any routes being defined in the base module (unless you have context_ui enabled, but if it's a required module than having it be separate doesn't really make sense, so perhaps moving some of the routes up to the parent module is needed).

replicaobscura’s picture

Status: Active » Needs review
StatusFileSize
new1.04 KB

Here's a patch that seems to fix the issue for me by moving only the entity.context.edit_form route up to the main context module instead of leaving it in context_ui.

Is this the right way to go? If so, should any other routes be promoted to the parent module?

replicaobscura’s picture

Note that this issue also exists on alpha1, and this patch does seem to resolve the issue on alpha1 as well, if anyone's running into this but worried about updating to a dev version.

utement’s picture

Status: Needs review » Reviewed & tested by the community

Patch produces warning:

warning: 1 line adds whitespace errors.

but it does apply correctly. Patcs solves issue.

Ready for commit.

dietr_ch’s picture

+1, patch works.

  • boshtian committed 79051b4 on 8.x-1.x authored by bmcclure
    Issue #2802253 by bmcclure, utement, dietr_ch: Error on multilingual...
boshtian’s picture

Status: Reviewed & tested by the community » Fixed
boshtian’s picture

Status: Fixed » Closed (fixed)