Steps to reproduce:

  1. Add code like this to your install profile:
    /**
     * Implements hook_system_info_alter().
     */
    function standard_system_info_alter(&$info, $file, $type) {
      if ($file->name == 'field_sql_storage') {
        $info['hidden'] = TRUE;
      }
    }
    
  2. Go to the admin/modules page and submit the form.
  3. Notice how a nonsensical confirmation message appears on the screen, telling you that you need to enable the Field SQL Storage module to proceed (even though it's a hidden, required module and therefore already enabled).

This bug affects e.g. Drupal distributions which might want to hide certain core required modules from appearing on the modules page in order to simplify it.

I'm attaching two patches, one which I think is correct and one which I almost thought was correct until I realized it causes a regression in certain edge cases. This patch will need tests either way, but I'm uploading both to see exactly what kinds of tests it will need; I'm hoping the second patch will fail existing tests, but I have a feeling it won't :)

Comments

David_Rothstein’s picture

The first patch had a typo in the code comment - reuploading.

Status: Needs review » Needs work
Issue tags: -Needs tests

The last submitted patch, hidden-required-modules-WRONG-FIX.patch, failed testing.

David_Rothstein’s picture

Status: Needs work » Needs review
m1n0’s picture

m1n0’s picture

#1: hidden-required-modules.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Needs tests

The last submitted patch, hidden-required-modules-WRONG-FIX.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new884 bytes
new1.01 KB

Rerolled against 8.x HEAD at the London Ontario Drupal Users Group.

Status: Needs review » Needs work

The last submitted patch, 1205684-7-WRONG-FIX.patch, failed testing.

lliss’s picture

This is a tricky one test test I think. We want a test module that relies on a hidden module and shows up on the modules page for testing. But we don't want this to show up normally. My approach was to make a test module that relies on another test module and then have the first module override the info of the second so that it sets it to hidden = FALSE. Then we just need to have the test enable the first module and try to enable the second module through the interface. So far this hasn't gone well in my experiments as I am not successfully able to override the hidden property.

lliss’s picture

StatusFileSize
new2.99 KB

This is a decent start for the test but needs some work still.

star-szr’s picture

Status: Needs work » Needs review

Thanks @lliss, that definitely looks like a good start!

Setting to needs review so testbot can run it. Can you please upload a patch combining the test along with the first patch in #7? See #13 in http://drupal.org/node/1468170.

Status: Needs review » Needs work

The last submitted patch, hidden-required-modules-1205684-10.patch, failed testing.

lliss’s picture

StatusFileSize
new0 bytes

Test and patch from #7 rolled into one.

lliss’s picture

Status: Needs work » Needs review
lliss’s picture

Doh. It helps to have something in the file.

The last submitted patch, hidden-required-modules-1205684-15.patch, failed testing.

heddn’s picture

Issue summary: View changes
Issue tags: +Issue needs confirmation

A lot has changed since 2012, please confirm this is still an issue.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Status: Needs work » Postponed (maintainer needs more info)
Issue tags: -

As said in #17 a lot has changed.

Can anyone confirm that this is still a problem?

pameeela’s picture

I remember this in D7 (pretty sure it occurred in aGov/GovCMS) but have never seen it in 8/9, even though there are enabled hidden modules, so I think it can be closed. Not sure how to completely confirm it though.

longwave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

I added this to system_system_info_alter:

  if ($file->getName() == 'system') {
    $info['hidden'] = TRUE;
  }

The modules list page now hides the System module, and submitting the form works as expected and produces no errors.

Closing this as outdated as there is nothing to do here.