Try to parse version in composer if not in .info.yml

Created on 16 May 2024, over 1 year ago

Problem/Motivation

From #3440128: version in info.yml for general project β†’ , when using an installation profile, there is no "version" put automatically in .info.yml file of the profile and in its modules/themes .info.yml files.

This will provoke a fatal error on status report page due to:

TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /project/app/core/lib/Drupal/Component/Render/FormattableMarkup.php on line 256 in Drupal\Component\Utility\Html::escape() (line 431 of core/lib/Drupal/Component/Utility/Html.php).
Drupal\Component\Render\FormattableMarkup::placeholderEscape(NULL) (Line: 229)
Drupal\Component\Render\FormattableMarkup::placeholderFormat('%profile_name (%profile-%version)', Array) (Line: 195)
Drupal\Core\StringTranslation\TranslatableMarkup->render() (Line: 15)
Drupal\Core\StringTranslation\TranslatableMarkup->__toString() (Line: 336)
Twig\Template->render(Array) (Line: 38)
Twig\TemplateWrapper->render(Array) (Line: 39)
twig_render_template('core/themes/claro/templates/status-report-grouped.html.twig', Array) (Line: 348)
Drupal\Core\Theme\ThemeManager->render('status_report_grouped', Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 203)
Drupal\Core\Render\Renderer->render(Array) (Line: 475)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 80)
__TwigTemplate_71280d5a17f166e234dcd7a30c6eb76d->doDisplay(Array, Array) (Line: 360)
Twig\Template->yield(Array) (Line: 335)
Twig\Template->render(Array) (Line: 38)
Twig\TemplateWrapper->render(Array) (Line: 39)
twig_render_template('core/themes/claro/templates/status-report-page.html.twig', Array) (Line: 348)
Drupal\Core\Theme\ThemeManager->render('status_report_page', Array) (Line: 446)
...

Also it would be nice that this kind of information would be handled with Composer data directly. Not only for installation profile, but also for modules and themes.

Steps to reproduce

Install a module in dev version using composer composer require drupal/address:2.0.x-dev.
On admin/modules, there is no indicated version for the module.

Proposed resolution

Try to get data from Composer.

Remaining tasks

- POC: MR incoming
- handle sub-extensions
- if possible make the hardcoded 'drupal/' dynamic.

User interface changes

Versions of extensions not present in .info.yml but handled with Composer will be displayed on the admin pages.

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
ExtensionΒ  β†’

Last updated about 1 month ago

No maintainer
Created by

πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024