Fatal Error on modules page if any module.info.yml has parser error

Created on 19 February 2015, about 10 years ago
Updated 11 March 2023, about 2 years ago

Problem/Motivation

Site displays Fatal Error on modules page if any of the module.info.yml has parser error (even for not installed modules)

// example error message
Drupal\Core\Extension\InfoParserException: Unable to parse sites/all/modules/custom/example/example.info.yml: Unable to parse at line 9 (near "version ="). in Drupal\Core\Extension\InfoParser->parse() (line 40 of core/lib/Drupal/Core/Extension/InfoParser.php). 

Expected Result:

  1. Disable that module or Mark it 'not supported' or Mark it 'not met the requirements'.

What happened instead?:

  1. Fatal Error page.

Steps to reproduce

Steps to reproduce:

  1. Put a info.yml file with yml syntax error.
  2. Visit /admin/modules page.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

9.5

Component
Extension 

Last updated 2 days ago

No maintainer
Created by

🇮🇳India vinoth.3v

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone

    I read the issue summary and the criteria for a bug . While this is clearly a PHP error, it does happen in development and not on production sites. The error message itself gives the developer the information needed to correct the problem. I am changing to a task.

    This may also be working as designed but I will ask in #bugsmash.

  • 🇳🇿New Zealand quietone

    I asked in #bugsmash about this. We agreed that this is a task and larowlan pointed out that this is a suitable first time issue. Adding novice tag.

  • 🇮🇳India rckstr_rohan

    InfoParserException exception can handle 'core_version_requirement' issue.

  • 🇳🇱Netherlands e.ruiter

    I agree with #18. The error message is very useful for developers. I don't see what should be changed to make this any better.

  • 🇨🇭Switzerland berdir Switzerland

    This was open for 10 years and it was changed to a task bit it's imho unclear what the task would be.

    Let's just close it?

Production build 0.71.5 2024