Skip to content

Installer gives error message if project name != module name #6901

Open
@swampopus

Description

@swampopus

Description of the bug

The best example is the project "front", which I just recently converted over. The repository is simply called "front", which is the Front Page module from Drupal (with front_page.info and front_page.module). The problem is that the module itself was actually named front_page.module and front_page.info, while the repository is simply called front.

As a result, when you use the Installer to 'Install new module' and select the Front Page module, it would install, but on the page where it asks you to enable it, an error is shown instead. It is generated from installer.pages.inc, function installer_browser_installation_enable_form().

Specifically, it's the "else" condition to this IF statement:
if (isset($modules[$project['name']]))

Expected behavior

The function install_browser_installation_enable_form() should, in the $projects variable, have the module_name set. In this case, it would be 'front_page'. Then, throughout the function, instead of checking $project['name'], it should check $project['module_name'].

This would then allow us to enable the module normally, and not receive the error message.

Alternate behavior option

Add rules to backdrop-contrib packaging/installation system such that a repository must exactly match the module name. Also include this rule in the documentation.;

Additional information

  • Backdrop CMS version: 1.30.2

In the meantime...

I am going to refactor the "front_page" module such that it is "front.module" instead of "front_page.module", so that it will work correctly with the backdrop installer. Also in the future I will make sure the repository has the same name as the module, regardless of what Drupal names it.

But I wanted to bring this to the attention of the group.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions