Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291711

Module constraint checks fail incorrectly due to str_replace

$
0
0

When viewing the module list at /admin/modules the checkboxes are disabled if any of the dependencies of that module are not present. At core 8.7 this worked fine. But at 8.8 if a module depends on a core module with a given version, the test always fails.

An example of this is Views Bulk Operations, which depends on Views >=8.4 (ie core 8.4 and up). This test passed OK at Core 8.7 but at Core 8.8 the test fails and VBO cannot be installed. This seems to be due to a quirk in the programming in core/modules/system/src/Form/ModulesListForm.php, where the string \Drupal::CORE_COMPATIBILITY . '-' i.e. '8.x-' in this case, is removed from the module version. The intention is probably to convert contrib module versions, say '8.x-1.2' into '1.2'. When the module is a core module the version at core 8.7 was 8.7.x-dev and this gets passed through and all works fine.

But at Core 8.8 we have the unintended side-effect that removing '8.x-' also matches the middile of the core version '8.8.x-dev' so the value passed on is '8.dev' which fails to satisfy the constraint test >=8.4

To see this bug in action, create a core 8.8 dev site, download Views Bulk Operations and try to enable it.


Viewing all articles
Browse latest Browse all 291711

Trending Articles