This module is workaround for issue https://www.drupal.org/project/drupal/issues/3129577, it is simple module to fix missing context entity tokens

Project link

https://www.drupal.org/project/node_token_filter

Comments

aram.gevorgyan created an issue. See original summary.

vishal.kadam’s picture

Title: Node Token Filter » [1.0.x] Node Token Filter
Issue summary: View changes
Priority: Critical » Normal
Issue tags: -token replacement
avpaderno’s picture

Assigned: Unassigned » avpaderno

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, enable GitLab CI for the project, and fix what reported from the phpcs job. This help to fix most of what reviewers would report.
  • For the time this application is open, only your commits are allowed. No other people, including other maintainers/co-maintainers can make commits.
  • 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.
  • Nobody else will get the permission to opt projects into security advisory policy. If there are other maintainers/co-maintainers who will to get that permission, they need to apply with a different module.
  • 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. The configuration used for these tools needs to be the same configuration used by GitLab CI, stored in the GitLab Templates repository.
  • 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.

avpaderno’s picture

Status: Active » Needs work

Usually, after reviewing a project, we allow the developer to opt projects into security advisory coverage. This project is too small for us; it does not contain enough PHP code to really assess your skills as a developer.

Do you have any other project hosted on drupal.org that we could instead review? It needs to have most of the commits (but preferably all the commits) done by you, in at least a branch.

avpaderno’s picture

Assigned: avpaderno » Unassigned
aram.gevorgyan’s picture

Hi did you check my last comment about additional works?
https://www.drupal.org/project/projectapplications/issues/3516483#commen...

aram.gevorgyan’s picture

Priority: Normal » Critical
Status: Needs work » Active
aram.gevorgyan’s picture

Priority: Critical » Normal
avpaderno’s picture

We need a project were most of the commits, but preferable all the commits, have been done by you. We do not review patches or merge requests.

avpaderno’s picture

Status: Active » Closed (won't fix)

I am closing this application because the status set by the applicant was Active, and the applicant has not posted any comment in this application in the past two weeks.

Feel free to re-open it, if you are the applicant and you are sure you can follow this application the time necessary to get it closed as fixed.

aram.gevorgyan’s picture

Hi avpaderno, I have releised new version of this module. Can you please take a look again.
Thanks.

aram.gevorgyan’s picture

Status: Closed (won't fix) » Active
aram.gevorgyan’s picture

Title: [1.0.x] Node Token Filter » [1.1.x] Node Token Filter
vishal.kadam’s picture

Title: [1.1.x] Node Token Filter » [1.0.x] Node Token Filter
avpaderno’s picture

Remember to change status, when the project is ready for review, as in this queue Active means Don't review yet the project I am using for this application.

aram.gevorgyan’s picture

Status: Active » Needs review
aram.gevorgyan’s picture

Title: [1.0.x] Node Token Filter » [1.1.x] Node Token Filter
avpaderno’s picture

Assigned: Unassigned » avpaderno
avpaderno’s picture

Title: [1.1.x] Node Token Filter » [1.0.x] Node Token Filter
Assigned: avpaderno » Unassigned
Status: Needs review » Needs work

What I reported in my previous comment still holds true. Taking out boilerplate code, this is the only PHP code to review.

  public function settingsForm(array $form, FormStateInterface $form_state) {
    $form['replace_empty_token'] = [
      '#type' => 'checkbox',
      '#title' => $this->t('Replace empty tokens'),
      '#description' => $this->t('Remove tokens from text if they cannot be replaced with a value'),
      '#default_value' => $this->settings['replace_empty_token'],
    ];

    return $form;
  }

  public function process($text, $langcode) {
    $node = $this->routeMatch->getParameter('node');
    if (!empty($node)) {
      $token_data = ['node' => $node];
    }
    else {
      if ($this->moduleHandler->moduleExists('group')) {
        $group = $this->routeMatch->getParameter('group');
        if (!empty($group)) {
          $token_data = ['group' => $group];
        }
      }
    }

    if (!empty($token_data)) {
      $token_options = ['clear' => $this->settings['replace_empty_token']];
      $text = $this->token->replace($text, $token_data, $token_options);
    }
    return new FilterProcessResult($text);
  }
vishal.kadam’s picture

1. FILE: README.md

The README file is missing the required sections - Project introduction and Configuration.

2. FILE: src/Plugin/Filter/NodeFilterToken.php

  /**
   * VideoEmbedWysiwyg constructor.
   *
   * @param array $configuration
   *   Plugin configuration.
   * @param string $plugin_id
   *   Plugin ID.
   * @param mixed $plugin_definition
   *   Plugin definition.
   * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
   *   The route match.
   * @param \Drupal\Core\Routing\RouteMatchInterface $module_handler
   *   The module handler.
   * @param \Drupal\Core\Utility\Token $token
   *   The token service.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteMatchInterface $route_match, ModuleHandlerInterface $module_handler, Token $token) {

The documentation comment for constructors is not mandatory anymore, If it is given, the description must be “Constructs a new [class name] object”, where [class name] includes the class namespace.

aram.gevorgyan’s picture

Hi Team, because my module code is too small, here is the one commit by me for another contrib module
https://git.drupalcode.org/issue/message-3551330/-/commit/8714502aecafa4...

aram.gevorgyan’s picture

Status: Needs work » Needs review
avpaderno’s picture

Status: Needs review » Needs work

That is a commit for a issue fork.
If you do not have the permission to make commits for that project, and you made most of the commits (preferably, all the commits) for that project, that project cannot be used for these applications.

aram.gevorgyan’s picture

Hi @avpaderno, good to know, in that case we will wait agin until I will add some new chunk of code or another contrib module as I understood?

rushikesh raval’s picture

Priority: Normal » Minor

I am changing priority as per Issue priorities.

avpaderno’s picture

@aram.gevorgyan Either this project contains more code (which is not boilerplate code), or you use a different project where you made most of the commits.

avpaderno’s picture

Status: Needs work » Closed (won't fix)

This thread has been idle, in the Needs work state with no activity for about six months or more; the application has been created about 11 months ago or more. Therefore, I marked it as Closed (won't fix).

If this is incorrect, and you are still pursuing this application, please feel free to re-open it and set the issue status to Needs work or Needs review, depending on the current status of your code.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.