Allow discovering where nested paragraphs are used

Created on 7 January 2025, about 2 months ago

Problem/Motivation

When drilling down in nested paragraphs, there is currently no way to see where the paragraphs are used, because the edit link will go to a non-existing paragraph edit form like /admin/content/paragraphs/22544/edit.

It would be nice in the case of nested paragraphs to be able to click through to a page that lists where the paragraphs are used.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇧🇬Bulgaria pfrenssen Sofia

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

Merge Requests

Comments & Activities

  • Issue created by @pfrenssen
  • Merge request !4Allow to drill down nested paragraphs. → (Open) created by pfrenssen
  • Thank you, I like the changes!

    Some small remarks for the MR !4.

    In src/ParagraphsStats.php:556, there's the following switch statement:

    switch ($rec->parent_type) {
              case 'node': ...
              case 'paragraph': ...
              case 'block_content': ... 
    

    As far as I can tell, there's no error handling here if the $rec->paren_type is none of the above cases, right? Maybe logging/throwing an error here would be an appropriate error handling.

    Another small remark is about the renaming of the row cells from @id/edit to Paragraph @id. I believe the Paragraph @id naming doesn't have enough information value, as it's very similar to the first entry of the row and doesn't convey the information that this is an edit link. Therefore I suggest keeping the @id/edit naming or changing it to something like Edit Paragraph @id

  • 🇧🇬Bulgaria pfrenssen Sofia

    As far as I can tell, there's no error handling here if the $rec->paren_type is none of the above cases, right? Maybe logging/throwing an error here would be an appropriate error handling.

    The module doesn't seem to query any other entity types at the moment (ref. ::getSqlLeftJoin()) but I will add a fallback to future proof it. Logging or throwing an error message would not be useful IMO because this would alert the site owner but they cannot do anything on their end to solve this.

    I believe the Paragraph @id naming doesn't have enough information value, as it's very similar to the first entry of the row and doesn't convey the information that this is an edit link. Therefore I suggest keeping the @id/edit naming or changing it to something like Edit Paragraph @id

    .
    Good suggestion. It is confusing that the header says "Edit link" while the links no longer lead to edit links but instead to usage reports. I will fix this.

  • LGTM! thanks Pieter :)

Production build 0.71.5 2024