Problem/Motivation

If you have a module that is incompatible with your Drupal Installation for any reason (drupal version, php version etc), you get an error message saying that the module is not compatible. When such an error message appears, the module description is also hidden, which must be visible.

Proposed resolution

Display the module description irrespective of whether or not the module is compatible. Append the error messages (if any) to this description.

Remaining tasks

Verify if its actually desired and whether or not the original behavior is by design.

User interface changes

Module description visible even when it is not compatible.

API changes

n/a

Comments

cs_shadow’s picture

Issue summary: View changes
tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new602 bytes
new22.68 KB

How about this?

cs_shadow’s picture

Issue summary: View changes

Patch in #2 fixes the issue, though need to check if it is the desired behavior.

jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
AkshayKalose’s picture

Issue tags: -Needs reroll
StatusFileSize
new646 bytes

Rerolled

AkshayKalose’s picture

Status: Needs work » Needs review
StatusFileSize
new733 bytes

Adapt to screenshot: Incompatible Plugin

from comment #2

penyaskito’s picture

+++ b/core/modules/system/src/Form/ModulesListForm.php
@@ -369,7 +369,8 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
+      $row['description']['#prefix'] = $row['description']['#markup'] . '<br>';
+      $row['description']['#markup'] = '<strong>' . $status . '</strong>';

Why do we add html markup here? Original patch did not.

AkshayKalose’s picture

I added the HTML markup to adapt to the screenshot posted in comment #2. Otherwise, the description just comes before the error. How else can this be done?

penyaskito’s picture

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

It is still not clear to me why we didn't need markup in #2 and we need it on #6. If it is true, this should be in a template or something I guess.
Also, we would need a test.

AkshayKalose’s picture

StatusFileSize
new7.26 KB
new8.33 KB

$row['description']['#theme'] ='system_modules_incompatible'; was removed because 0 matches throughout Drupal.

Without markup:
Without markup

With markup:
With markup

Maxilver’s picture

It is a bad practice to add HTML tags in-line like that. I think we should create element in $row (w/ $status string) and then theming it with 'system_modules_details'.
Also I'm not sure it's worth to prepend description before collapsed notice. I mean that warning is more important for user. So I suggest to display a error message first.

The best way in my opinion show a description with other secondary module information. I have created a patch for it.
Only local images are allowed.
What do you think?

adci_contributor’s picture

Status: Needs work » Needs review
AkshayKalose’s picture

StatusFileSize
new1.36 KB

Added just test

Status: Needs review » Needs work

The last submitted patch, 13: module-description-test-2230865-13.patch, failed testing.

AkshayKalose’s picture

Status: Needs work » Needs review
StatusFileSize
new1.43 KB

Had error while copy/pasting from my other code-base in above patch. Corrected test patch included in this comment.

Status: Needs review » Needs work

The last submitted patch, 15: module-description-test-2230865-15.patch, failed testing.

AkshayKalose’s picture

Status: Needs work » Needs review
StatusFileSize
new4.17 KB

This patch contains patch from #11 and test update to ModulesListFormWebTest.

wylbur’s picture

Status: Needs review » Reviewed & tested by the community

Tested patch in message #17 on Drupal 8.0.x

Patch installed cleanly with no errors.

D8 module test

Installed a contrib module (Weight)
Module appeared in the module list at /admin/modules
Modified the yml file, changed CORE and DESCRIPTION
Checked the module list at /admin/modules and the module showed as incompatible, and showed updated core and description
Enabled Test module, and ran ModulesListFormWebTest
Results
27 passes, 0 fails, 0 exceptions, 6 debug messages

D8 module test w/o yml file

Installed a D8 module that did contain a .yml file
module was not listed in the module list at /admin/modules

D7 module test

Installed a D7 module (with no .yml file)
module was not listed in the module list at /admin/modules

Patch is functioning as intended.

wylbur’s picture

Issue tags: -Needs tests +Needs tests SprintWeekend2015

Adding SprintWeekend2015 tag!

manningpete’s picture

Issue tags: -Needs tests SprintWeekend2015 +Needs tests, +SprintWeekend2015
star-szr’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs tests

We have tests now, so that tag can be removed. Some minor feedback below, but overall this is looking good to me:

  1. +++ b/core/modules/system/system.admin.inc
    @@ -224,6 +224,8 @@ function theme_system_modules_details($variables) {
    +    $incompatible =!empty($module['incompatible']);
    

    Missing space after = sign.

  2. +++ b/core/modules/system/system.admin.inc
    @@ -224,6 +224,8 @@ function theme_system_modules_details($variables) {
    +    $title = drupal_render($module['description']);
    
    @@ -236,7 +238,11 @@ function theme_system_modules_details($variables) {
    +        $title = drupal_render($module['incompatible']);
    
    @@ -259,7 +265,7 @@ function theme_system_modules_details($variables) {
    -      '#title' => SafeMarkup::set('<span class="text"> ' . drupal_render($module['description']) . '</span>'),
    +      '#title' => SafeMarkup::set('<span class="text"> ' . $title . '</span>'),
    

    Why not just set $title and drupal_render() once? It seems like with this change we'd end up with unnecessary calls to drupal_render().

adci_contributor’s picture

Status: Needs work » Needs review
StatusFileSize
new689 bytes
new4.18 KB

About #21-2: It seems, rendered $module['description'] used, even if module is incompatible. So we anyway should call the drupal_render for 'description' element, and we do it only once. Guess, this is look good for me.

$title = drupal_render($module['description']);
...
if ($incompatible) {
$description .= '

' . t('Description: !module-description', array('!module-description' => $title)) . '

';
$title = drupal_render($module['incompatible']);
}

Сorrections of #21-1 are made.

mgifford’s picture

Status: Needs review » Needs work

No longer applies.

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.

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

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
quietone’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)
Issue tags: +Bug Smash Initiative
StatusFileSize
new12.39 KB

@cs_shadow, Thank you for reporting this problem. We rely on issue reports like this to improve Drupal core.

I don't know when this was fixed but the description does display when the module is not compatible. Tested on 9.4.x standard install.

Therefore, closing as outdated

Thanks!