Madrid
Account created on 17 December 2015, over 9 years ago
#

Merge Requests

More

Recent comments

🇪🇸Spain lpeidro Madrid

The functionality to enforce redirection is excellent; however, it currently applies to all content types. In some cases, certain content types are not used as full pages but rather as components. Therefore, it would be helpful to configure when this functionality should be applied.
To address this, I propose adding a form that allows us to select the applicable content types.

🇪🇸Spain lpeidro Madrid

It would be great if a message were displayed when a node is deleted and a redirection occurs. Currently, the user is only informed that the node was deleted, but not that they have been redirected.

🇪🇸Spain lpeidro Madrid

Hello Antonio:

Just I did some small changes:
- Added settings schema and default value.
- If the redirect is required, we don't need to show the checkbox.

It works as expected.

Thank you very much.

🇪🇸Spain lpeidro Madrid

I have review the code and it looks great. I added a suggestion in the code.
Thanks your, Edu.

🇪🇸Spain lpeidro Madrid

The code and functionality have been reviewed and are working as expected. The titles in different languages are displayed based on the source or target language.

🇪🇸Spain lpeidro Madrid

The code and functionality have been reviewed. It has been verified that when executions are triggered from the Drupal administration, the theme switches to the default theme at the moment the node is rendered.

Therefore, it works correctly.

🇪🇸Spain lpeidro Madrid

I refactored the code to make it more readable and tested it. Everything works as expected, so it's ready to be merged.

🇪🇸Spain lpeidro Madrid

lpeidro made their first commit to this issue’s fork.

🇪🇸Spain lpeidro Madrid

I have checked the code and I looks great. I think is ready for new version more stable.

Thank you very much.

🇪🇸Spain lpeidro Madrid

I’ve moved all the logic for calculating the path and route name of tasks and groups from the Plugin Manager to the Repository service, to decouple the logic and improve modularity.

I also created a trait to handle the logic for building task items in the controller, since the same logic applies to both cases.

The rest of the implementation looks great and works as expected. Thanks, Antonio, for your work!

I merge the branch.

🇪🇸Spain lpeidro Madrid

I have merged the branch. Thank you Antonio and Jonathan.

🇪🇸Spain lpeidro Madrid

There are many cases to manage. To avoid reducing the cases, a method has been implemented as the first one executed to detect whether the route corresponds to an entity route in the most flexible way possible, regardless of the entity type.

To achieve this, we use two criteria:

  • The route name starts with "entity".
  • There is a parameter of type entity converter.

Additionally, this parameter provides the key to retrieving the entity from the $route_match variable.

Ready for validation.

🇪🇸Spain lpeidro Madrid

lpeidro changed the visibility of the branch 3512879-false-access-denied-link-with to hidden.

🇪🇸Spain lpeidro Madrid

lpeidro changed the visibility of the branch 3512879-false-access-denied-link-with to hidden.

🇪🇸Spain lpeidro Madrid

I’m using this issue to introduce two minor changes:

  • Restrict access to the ability to launch the Batch.
  • Add the subcategory field and filter to the Entity Mesh view of nodes.

It works as expected.
I merge the issue.

🇪🇸Spain lpeidro Madrid

I have to refactor how the database query is built. Using Aggregate Query and conditions is not working properly.

I tried adding a condition to the query, but I suddenly realized that it wasn't necessary. It was enough to simply add a new groupBy to the query.

This way, there is no need to run two queries—one for published and another for unpublished content.

    $query = $this->entityTypeManager
      ->getStorage('node')
      ->getAggregateQuery()
      ->accessCheck(FALSE)
      ->aggregate('nid', 'count', NULL, $alias_count)
      ->groupBy('type')
      ->groupBy('status');
    $query = $this->entityTypeManager
      ->getStorage("node")
      ->getAggregateQuery()
      ->accessCheck(FALSE)
      ->aggregate('nid', 'COUNT', NULL, $alias_count)
      ->groupBy('langcode')
      ->groupBy('type')
      ->groupBy('status');

Jonathan please, could review the code.

Thanks a lot.

🇪🇸Spain lpeidro Madrid

It is ready to review and to merge. But I am not create unit test for this case. Maybe we can create a new issue to generate the unit tests.

🇪🇸Spain lpeidro Madrid

The problem was in this part of the code in the class EntityRender:

  protected function setDataTargetFromRoute($target) {
    if (empty($target->getPath())) {
      return;
    }

    try {
      // @phpstan-ignore-next-line
      $route_match = \Drupal::service('router.no_access_checks')->match($target->getPath());
    }
    catch (\Exception $e) {
      $target->setSubcategory('broken-link');
      return;
    }

    // It is a view route.
    if (isset($route_match['view_id'])) {
      $target->setEntityType('view');
      $target->setEntityId($route_match['view_id'] . '.' . $route_match['display_id']);
      return;
    }

    // This case apply with entity canonical routes.
    $route_parts = explode('.', $route_match['_route']);
    if (count($route_parts) === 3 && $route_parts[0] === 'entity' && $route_parts[2] === 'canonical') {
      $entity_id = '';
      $entity = $route_parts[1];
      if (isset($route_match[$entity]) && $route_match[$entity] instanceof EntityInterface) {
        $entity_id = $route_match[$entity]->id();
      }
      $target->setEntityType($entity);
      $target->setEntityId((string) $entity_id);
    }
  }

The taxonomy term page is built using a view. For this reason, when the code detected that the view_id parameter was set in the $route_match variable, it handled the link as a view, without considering other parameters such as route_name.

When a taxonomy term had an alias, the entity was processed earlier, and this method was not called.

I have modified the code to be more precise in this aspect:

protected function setDataTargetFromRoute($target) {
    if (empty($target->getPath())) {
      return;
    }

    try {
      // @phpstan-ignore-next-line
      $route_match = \Drupal::service('router.no_access_checks')->match($target->getPath());
    }
    catch (\Exception $e) {
      $target->setSubcategory('broken-link');
      return;
    }

    if (empty($route_match['_route'])) {
      $target->setSubcategory('broken-link');
      return;
    }

    // @todo Maybe here is possible to get as well the entity object
    if (str_starts_with($route_match['_route'], 'view.')) {
      $target->setEntityType('view');
      $target->setEntityId($route_match['view_id'] . '.' . $route_match['display_id']);
      return;
    }

    // This case apply with entity canonical routes.
    $route_parts = explode('.', $route_match['_route']);
    if (count($route_parts) > 1) {
      $entity_id = '';
      $entity = $route_parts[1];
      if (isset($route_match[$entity]) && $route_match[$entity] instanceof EntityInterface) {
        $entity_id = $route_match[$entity]->id();
        $entity = $route_match[$entity]->getEntityTypeId();
      }
      $target->setEntityType($entity);
      $target->setEntityId((string) $entity_id);
    }
  }
🇪🇸Spain lpeidro Madrid

It is ready for testing. Unit test added and ready to review.

🇪🇸Spain lpeidro Madrid

Thank you, Jonhattan, I merge the branch.

🇪🇸Spain lpeidro Madrid

The issue with false broken links occurred when removing the langcode from the href to search for the alias. The removal of the langcode deleted its occurrence anywhere in the string, which in some cases modified the URL.

The code has been updated so that it is only removed at the beginning of the string, if it exists.

🇪🇸Spain lpeidro Madrid

It works as expected. I merge the branch. Thank you Antonio.

🇪🇸Spain lpeidro Madrid

Merge the Issue, thank you Sady and Anotnio.

🇪🇸Spain lpeidro Madrid

I added some minor points.

It works as is expected.

Thank you very much Antonio.

I merge the issue.

🇪🇸Spain lpeidro Madrid

Taking advantage of this specific issue for the Paragraph case, we have implemented functionality to manage the dependency between insights and their plugin tasks.

The dependency on the modules is set in the Task Plugin definition. If the dependency is broken, the Task Plugin will be disabled. Similarly, in the insight, if the Task Plugin is inactive due to dependency issues, the corresponding insight will not be executed under any circumstances.

It is ready for testing.

🇪🇸Spain lpeidro Madrid

Perfect, it works as expected. I merge the branch. Thanks Edu.

🇪🇸Spain lpeidro Madrid

Hello,

We are experiencing this issue on a client project, but the solution proposed by maximpodorov is not working properly in our case and does not resolve the issue.

We have created a simple module that might be useful to help solve this problem Url Purge Aggregator .

It is a very simple queuer that adds the URLs to the Purge queue when a node is edited or removed. This functionality can be enabled through configuration.

In this case, it would be necessary to implement the hook_entity_insert() hook to use the service provided by the module (url_purge_aggregator.queuer) to add the node's URL when it is created.

I am going to create an issue to add this option as well.

I hope this module can be useful.

🇪🇸Spain lpeidro Madrid

lpeidro created an issue.

🇪🇸Spain lpeidro Madrid

Hello Omar:

Thank you very much for your contribution. However, the most appropriate way to fix this issue is to prevent the insight logic from running when the Paragraphs module is not enabled.

I believe it would be better to ask the plugins if they have any dependencies that are not available.

There is already some logic for this in the task plugins, but the result is not currently propagated to the insights.

🇪🇸Spain lpeidro Madrid

Branch merged, and a new issue was created to apply the definitive fix: https://www.drupal.org/project/entity_mesh/issues/3509575 🐛 Manage dependencies in sites that are not multilingual Active

🇪🇸Spain lpeidro Madrid

It works as expected. Thank you very much, Edu.
I merge the branch.

🇪🇸Spain lpeidro Madrid

It works as expected. Thank you Edu, I merged the branch.

🇪🇸Spain lpeidro Madrid
  • I have added the GitLab CI configuration to run both static code analysis and unit tests in GitLab.
  • I have resolved some issues and added compatibility with Drupal 10.
  • I just merged it into the 2.x development branch.
🇪🇸Spain lpeidro Madrid

lpeidro made their first commit to this issue’s fork.

🇪🇸Spain lpeidro Madrid

I created a new branch (3506358-manage-dependency) to manage the service dependency without requiring the Language module to be enabled.

🇪🇸Spain lpeidro Madrid

Great, thank you very much!!!

🇪🇸Spain lpeidro Madrid

Hello, Joel:

We need this for a client to invalidate the CDN cache, as they are facing issues when editors update content or remove files.

At first, we planned to create a custom module, but then we found yours and didn’t want to reinvent the wheel.

However, due to the client's security policies, we can only implement custom modules or modules that are in stable versions.

I work for Metadrop, and we are very active in the community: https://www.drupal.org/metadrop

Thank you.

🇪🇸Spain lpeidro Madrid

Review the merge request and QA done.
It has been tested both with and without filters, and it works correctly.

It is mandatory to inform the user that is needed to manage the dependency with the module "views_data_export" before the update.

I merge the branch

🇪🇸Spain lpeidro Madrid

Thanks, it works as expected. I merge the branch.

🇪🇸Spain lpeidro Madrid

Thank you, guys. Great work. I merge the issue.

🇪🇸Spain lpeidro Madrid

Hello Mortona:

Thank you very much for your collaboration. Yes, it is a good idea to show a statistic about the field usage.

We will include that information.

🇪🇸Spain lpeidro Madrid

It works as expected. I merge the fix.

🇪🇸Spain lpeidro Madrid

I’ve only made one modification, which is extracting the logic that calculates the language prefix from the target object to the Repository service, as it’s also needed during the processing of redirects.

Could you please take a look and do a quick QA? Thanks!

🇪🇸Spain lpeidro Madrid

lpeidro made their first commit to this issue’s fork.

🇪🇸Spain lpeidro Madrid

It works as expected. I merge the branch.

🇪🇸Spain lpeidro Madrid

lpeidro made their first commit to this issue’s fork.

🇪🇸Spain lpeidro Madrid

Thanks you very much Edu, fix merged.

🇪🇸Spain lpeidro Madrid

We have added the possibility to download the report of block layout to be more useful for the user.

🇪🇸Spain lpeidro Madrid

I have refactored the code to show the summary in a table:

This is different from the original proposal, but I realized that this format is clearer for the user.

I merge the branch.

🇪🇸Spain lpeidro Madrid

Hello Sirclickalot:

Thank you very much for your feedback. We will fix the issue as soon as possible to ensure compatibility with sites that are not multilingual.

Best regards.

🇪🇸Spain lpeidro Madrid

Thank you Antonio and Sady for your colaboration.

🇪🇸Spain lpeidro Madrid

lpeidro made their first commit to this issue’s fork.

Production build 0.71.5 2024