- Issue created by @Chris Dart
- 🇮🇳India vishal.kadam Mumbai
Thank you for applying!
Please read Review process for security advisory coverage: What to expect → for more details and Security advisory coverage application checklist → to understand what reviewers look for. Tips for ensuring a smooth review → gives some hints for a smoother review.
The important notes are the following.
- If you have not done it yet, you should enable GitLab CI for the project and fix the PHP_CodeSniffer errors/warnings it reports.
- For the time this application is open, only your commits are allowed.
- The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status will not be changed by this application; once this application is closed, you will be able to change the project status from Not covered to Opt into security advisory coverage. This is possible only 14 days after the project is created.
Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage. - Only the person who created the application will get the permission to opt projects into security advisory coverage. No other person will get the same permission from the same application; that applies also to co-maintainers/maintainers of the project used for the application.
- We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.
To the reviewers
Please read How to review security advisory coverage applications → , Application workflow → , What to cover in an application review → , and Tools to use for reviews → .
The important notes are the following.
- It is preferable to wait for a project moderator before posting the first comment on newly created applications. Project moderators will do some preliminary checks that are necessary before any change on the project files is suggested.
- Reviewers should show the output of a CLI tool → only once per application.
- It may be best to have the applicant fix things before further review.
For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues → .
- 🇮🇳India vishal.kadam Mumbai
Remember to change status, when the project is ready to be reviewed. In this queue, projects are only reviewed when the status is Needs review.
- 🇺🇸United States Chris Dart
I have created a fork branch with the expected files. https://www.drupal.org/project/paragraph_lineage/issues/3528635 📌 Add .gitlab-ci.yml Active
https://git.drupalcode.org/project/paragraph_lineage/-/merge_requests/11
- 🇮🇳India vishal.kadam Mumbai
The changes should be committed directly to the project repository. Please note that we do not review merge requests.
- 🇮🇳India vishal.kadam Mumbai
1. FILE: README.md
The README file is missing the required sections → - Requirements and Configuration.
2. FILE: templates/paragraph-lineage.html.twig
<div class="field__label" aria-label="type">Type</div>
<div class="field__label" aria-label="paragraph-bundle">Bundle</div>
<summary>Preview</summary>
<h3>Lineage</h3>
<p>No ancestors available. This appears to be an orphan paragraph.</p>
<th>Type</th> <th>Bundle</th> <th>Preview</th> <th>Link</th>
Strings shown in the user interface must be translatable. That holds true also for strings used in template files.
3. FILE: src/Controller/ParagraphLineageViewController.php
/** * @var \Drupal\Core\Entity\EntityTypeManagerInterface */ private EntityTypeManagerInterface $entity_type_manager;
The parent class already has properties and methods for the entity type manager. There is no need to redefine properties for the same purpose; instead, the parent class methods should be used.
- 🇺🇸United States Chris Dart
This is ready for review. I have updated the README.md, and the classes and the translation tags. https://git.drupalcode.org/project/paragraph_lineage/-/jobs
- 🇮🇳India vishal.kadam Mumbai
1. Fix errors/warnings reported by phpcs and phpstan job of Gitlab CI.
2. FILE: templates/paragraph-lineage.html.twig
<div class="field__label" aria-label="type">Type</div>
<div class="field__label" aria-label="paragraph-bundle">Bundle</div>
<summary>Preview</summary>
<h3>Lineage</h3>
Still some string are not translatable.
- 🇺🇸United States Chris Dart
I have fixed the lines I missed earlier. All strings should now be translated in the twig file.
- 🇮🇳India vishal.kadam Mumbai
FILE: src/Plugin/Field/FieldFormatter/ParagraphIdLinkFormatter.php
$link_title = $this->t($label, ['@name' => $entity->label()]);
The first argument passed to t() must be a literal string.
- 🇺🇸United States Chris Dart
I have fixed the issue with the $this->t() string literal concern.
- 🇮🇳India vishal.kadam Mumbai
Rest looks fine to me.
Please wait for a Project Moderator to take a look and if everything goes fine, you will get the role.
- 🇮🇹Italy apaderno Brescia, 🇮🇹
Truly, this application should get reviewed by other reviewers too. A partial review is not sufficient to change the status to Reviewed & tested by the community.
- 🇷🇴Romania bbu23
Hi! Thank you for your contribution. Here's some additional feedback:
1. There are still unresolved phpcs issues (Standard and Practice).
2. I'm not a composer.json expert, but I don't think you are supposed to add this:
"extra": { "installer-name": "paragraph_lineage", "drupal": { "version": "1.0.x-dev", "datestamp": "1701234567", "security-coverage": { "status": "not-covered", "message": "Dev releases are not covered by Drupal security advisories." } } }
3. In the controller, the route match could be retrieved using the already available container instead of
$route_match = \Drupal::routeMatch();
.4. The module provides a configuration page, but there's no
configure:
key in the info file to the page route.5. While the
ParagraphLineageSettingsService
service seems to be providing a wrapper for retrieving and setting the module configuration, there are two observations:
- The installation of the module provides a default value for the configuration, therefore the following code cannot happen:// If no theme is set, return the admin theme. if (!$theme) { // Get the admin theme from the typed config manager. $theme = 'admin'; }
- There can be issues with
getPreferredThemeId()
when used inParagraphLineageSettingsForm
. A configuration form when providing editable config names, it normally gets the editable configuration object. By using your service in the form, the default value is coming from an immutable configuration, which means that it can include overrides.6. The
$typedConfigManager
and$themeManager
arguments don't seem to be used in the service.7. In the
ParagraphIdLinkFormatter.php
file, theviewElements
method, you are building an entity canonical Url using theUrl::fromRoute()
approach, but when you have the entity object instance ofEntityInterface
, you can use the entity to generate the Url. E.g.:if ($entity->hasLinkTemplate('canonical')) { $url = $entity->toUrl(); }
8. Usually when defining plugins, it is recommended to prefix the IDs with your module's machine name to prevent conflicts with other modules. Your plugin IDs start with
file
andparagraph
.9. It would be good to provide help page.
- 🇺🇸United States Chris Dart
Thank you! I have fixed all of these items, but one I'm not sure I understand is this:
- There can be issues with getPreferredThemeId() when used in ParagraphLineageSettingsForm. A configuration form when providing editable config names, it normally gets the editable configuration object. By using your service in the form, the default value is coming from an immutable configuration, which means that it can include overrides.
It is used only in read-only situations. Is there a feature in forms that would require this?
By the way, I know it is probably overkill to have a service for these settings. I often build a settings service for my modules because I often need to call the settings from multiple places. It's easier to track names and keep them abstracted in methods in one place. It's kind of future-proofing if I want to add and make available settings throughout my module (or other modules as the case may be). But maybe in this module it would be easier to just have the form handle getting and setting services like usual.
- 🇷🇴Romania bbu23
Thanks, Chris.
I like and understand the organization of the service. I'm just pointing out what can happen with overrides when used in an editable context. You can perform some tests by overriding the configuration in
settings.php
and see what happens when you edit the form. It's up to you if you want to do something about it or not. - 🇷🇴Romania bbu23
Actually, I see that you've already modified the service to:
public function getPreferredThemeId(): string { // Retrieve the preferred theme from the configuration. $config = $this->configFactory->getEditable(self::CONFIG_NAME); return $config->get('preferred_theme') ?? 'admin'; }
Maybe you can update this to make it work for both cases. Something like:
public function getPreferredThemeId(bool $editable = FALSE): string { // Retrieve the preferred theme from the configuration. $config = $editable ? $this->configFactory->getEditable(self::CONFIG_NAME) : $this->configFactory->get(self::CONFIG_NAME); return $config->get('preferred_theme') ?? 'admin'; }
This way, everything is covered. And in the settings form you call this with
getPreferredThemeId(TRUE)
. Otherwise, in its current form the overrides won't work at all outside the Settings form.Overrides apply to immutable configs. So, if someone wants to override the config in
settings.php
and you always retrieve the configuration as editable, they won't work. - 🇺🇸United States Chris Dart
I have updated the interface to use the code you suggested and added a UX help. I also added information indicating that the setting has been overridden in settings.php in the form interface. The user cannot change the setting because it is overridden.
- 🇷🇴Romania bbu23
Thanks, Chris.
Apparently there're still just a few warnings by phpcs. Other than that, everything else looks good to me.
FILE: /var/www/html/web/modules/contrib/paragraph_lineage/tests/src/Unit/Plugin/Field/FieldFormatter/MockFieldItem.php ---------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES ---------------------------------------------------------------------------------------------------------------------- 47 | WARNING | There must be no blank line following an inline comment 117 | WARNING | There must be no blank line following an inline comment ---------------------------------------------------------------------------------------------------------------------- FILE: /var/www/html/web/modules/contrib/paragraph_lineage/src/Form/ParagraphLineageSettingsForm.php ------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------------- 96 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and | | $this->t() instead -------------------------------------------------------------------------------------------------------------------------------
- 🇺🇸United States Chris Dart
I have pushed up those changes you asked for and merged them to my main branch. Should be all good.
- 🇷🇴Romania bbu23
Sorry, Chris, you missed the warning about the
t()
call inParagraphLineageSettingsForm.php
. - 🇷🇴Romania bbu23
Just noticed something else in
paragraph_lineage.install
: RemoveImplements hook_update_N().
in the update functions descriptions. We don't want to see that text when running the updates.And just a side note, you should consider revisiting the doc page for the update hook numbers. Your hooks are running for D9 minimum (which is fine now, no change required), maybe in the future you want to consider increasing the core number.
- 🇺🇸United States Chris Dart
Sorry I missed the one t(). I have fixed that. I have also removed the Implements lines in the install file.
- Status changed to RTBC
about 19 hours ago 3:52pm 4 August 2025 - 🇺🇸United States Chris Dart
What are the next steps to getting this module approved?