[1.0.x] Structure Map

Created on 8 July 2024, 9 months ago

## INTRODUCTION

The Structure Map module helps you to visualize the structure of your entities
and bundles. Including the basic entiry information, editorial permissions,
display modes, field settings, etc.

The primary use case for this module is to provide a simple way to understand
a site architecture. This is specially helpful when you have a complex site
with many entities and bundles and you need to capture the current architecture
of the site.

## REQUIREMENTS

This module depends on the following modules:

- Configuration Manager
- Entity
- Field
- System
- Field UI
- Menu UI
- Custom Menu Links
- Link
- User

## INSTALLATION

Install as you would normally install a contributed Drupal module.
See: https://www.drupal.org/node/895232 โ†’ for further information.

## CONFIGURATION

- This module doesn't require any configuration.

## USAGE

- Go to `/admin/structure/map` and select an entity type and bundle.
- The module will generate a structure map for the selected values.

## MODULE LINKS

Structure Map Module Page โ†’
Source Code

## OTHER MODULES CREATED BY @AlvarodeMendoza
Lingo24 Translation Provider โ†’

๐Ÿ“Œ Task
Status

Needs review

Component

module

Created by

๐Ÿ‡ช๐Ÿ‡ธSpain alvarodemendoza

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

Comments & Activities

  • Issue created by @alvarodemendoza
  • ๐Ÿ‡ฎ๐Ÿ‡ณ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 run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
    • 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 won't be changed by this application and no other user will be able to opt projects into security advisory policy.
    • 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 Code Review Administrator before commenting on newly created applications. Code Review Administrators 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 โ†’ .

  • Status changed to Active 9 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai
  • ๐Ÿ‡ฎ๐Ÿ‡ณ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.

  • Status changed to Needs review 9 months ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain alvarodemendoza

    Reviewed coding standards and log warnings.

  • Status changed to Needs work 9 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai

    1. 1.0.x-dev is a wrong name for a branch. Release branch names always end with the literal .x as described in Release branches โ†’ .

    2. Fix phpcs issues.

    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml structure_map/
    
    FILE: structure_map/src/StructureMapTable.php
    -------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 4 LINES
    -------------------------------------------------------------------------------
     167 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
     185 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
     239 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
     256 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
    -------------------------------------------------------------------------------
  • ๐Ÿ‡ช๐Ÿ‡ธSpain alvarodemendoza

    @vishal.kadam do you mean that I have to remove the 1.0.x-dev branch from drupalcode?
    Let me know how to proceed with the branch because I just followed the instruction on the version control page of the module, that were to first create the 1.0.x, push and then create the 1.0.x-dev and push.

    For the phpcs, my local is not getting that for the arrays so I just fixed based on the info you posted here.

    Thank you,

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai

    Yes, you have to remove the '1.0.x-dev' branch.

  • Status changed to Needs review 9 months ago
  • Status changed to RTBC 9 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai

    Rest looks fine to me.

    Letโ€™s wait for a Code Review Administrator to take a look and if everything goes fine, you will get the role.

  • Status changed to Needs review 9 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    Please, do not change the status to Reviewed & tested by the community if no manual review has been done.

    While project moderators review applications, their main task is giving to the applicants the drupal.org role necessary to opt projects into security advisory coverage. This application is not waiting for a project moderator, but another person who makes a deeper review that does not involve any automatic tool.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    As a side note, it will not be possible to opt this project into security advisory coverage, before July 18, 2024. The form element to do that is programmatically disabled for ten days after the project has been created.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai

    I am changing priority as per Issue priorities โ†’ .

  • Status changed to Needs work 7 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    • The following points are just a start and don't necessarily encompass all the changes that may be necessary
    • A specific point may just be an example and may apply in other places
    • A review is about code that does not follow the coding standards, contains possible security issues, or does not correctly use the Drupal API; the single points are not ordered, not even by importance

    src/Controller/StructureMapController.php

    I would rather not use ControllerBase as parent class, since it is not using any method from that class. Controllers do not need to have a parent class; as long as they implement ContainerInjectionInterface, they are fine.

    src/Form/StructureMapFilterForm.php

      /**
       * Constructs the EntityDiagramController.
       *
       * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager
       *   The EntityFieldManagerInterface service.
       * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
       *   The EntityFieldManagerInterface service.
       * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
       *   The EntityTypeBundleInfoInterface service.
       * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
       *   The route matcher service.
       */
      public function __construct(EntityFieldManagerInterface $entity_field_manager, EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, RouteMatchInterface $route_match) {
        $this->entityFieldManager = $entity_field_manager;
        $this->entityTypeManager = $entity_type_manager;
        $this->entityTypeBundleInfo = $entity_type_bundle_info;
        $this->routeMatch = $route_match;
      }
    

    The class is not EntityDiagramController.

    src/EntityTypeInfo.php

              // Add the information to the summary.
              $field_type_summary .= '<br/>Number of entities using this reference field: ' . $entity_count;
    

    Strings shown in the user interface must be translatable.

          $build['table_' . $display_mode] = [
            '#type' => 'table',
            '#prefix' => '<h4>' . $this->t('Display Mode: @label', [
              '@label' => htmlspecialchars($info['label']),
            ]) . '</h4>',
            '#header' => $header,
            '#rows' => $rows,
            '#attributes' => [
              'class' => [
                'form-display-table',
                'structure-map-table',
              ],
            ],
          ];
    

    There is no need to pass a @-placeholder to htmlspecialchars(); that is already done by Drupal core.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain alvarodemendoza

    @avpaderno I fixed the things you flagged except for the ControllerBase because it is using the string translation trait in one side and I may implement other methods from that class as the project progresses.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rushiraval

    I am changing priority as per Issue priorities โ†’ .

  • Status changed to Needs review 5 months ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain alvarodemendoza

    Any updates on this? Thank you,

  • ๐Ÿ‡ช๐Ÿ‡ธSpain alvarodemendoza

    I am changing priority to Critical as per Issue priorities โ†’ .

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aneeshthankachan

    I have reviewed this module and features after installing it. This works as expected in terms of the features, and is quite useful to document and understand different entities used within a Drupal application.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom samberry

    I have also reviewed this module and works as expected and is a great tool for gaining information about entity structures within a drupal application.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rushiraval

    @aneeshthankachan and @samberry it is not review of module working. It review of code.

    if you want to review application in this queue then go through following which will help you to review application.

    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 run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
    • 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 won't be changed by this application and no other user will be able to opt projects into security advisory policy.
    • 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 Code Review Administrator before commenting on newly created applications. Code Review Administrators 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

    @aneeshthankachan and @samberry
    To make the previous comment clearer: This application requires reviewers to review the project files and report what needs to be changed. We do not debug projects or verify their functionality.

  • Status changed to Fixed 2 months ago
  • ๐Ÿ‡ฆ๐Ÿ‡นAustria klausi ๐Ÿ‡ฆ๐Ÿ‡น Vienna

    manual review:

    1. StructureMapFilterFormExport: exporting to the public file system is not ideal, because then you are showing that to any user? I think it is not a security issue because there is no secret data in the structure of your entity and fields? Ideally you would export to private files, then only authorized users can download the export file.
    2. The export files are never deleted? That could clutter disk space, probably makes sense to cleanup somewhere.

    Looks good to me otherwise.

    Thanks for your contribution, รlvaro!

    I updated your account so you can opt into security advisory coverage now.

    Here are some recommended readings to help with excellent maintainership:

    You can find lots more contributors chatting on Slack โ†’ or IRC โ†’ in #drupal-contribute. So, come hang out and stay involved โ†’ !

    Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review โ†’ . I encourage you to learn more about that process and join the group of reviewers.

    Thanks to the dedicated reviewer(s) as well.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024