Description

The module provides a block with accessibility utilities to help users change colour contrast and font size.

Project page

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

Git instructions

git clone --branch 1.0.x https://git.drupalcode.org/project/civic_accessibility_toolbar.git

PAreview checklist

http://pareview.net/r/34

Comments

ralliaf created an issue. See original summary.

arturopanetta’s picture

Status: Active » Needs work

phpcs --standard=Drupal --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md,yml' --ignore='node_modules,bower_components,vendor,assets' civic_accessibility_toolbar

FILE: civic_accessibility_toolbar/README.txt
-----------------------------------------------------------------------------------
FOUND 1 ERROR AND 6 WARNINGS AFFECTING 7 LINES
-----------------------------------------------------------------------------------
  5 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
  7 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 20 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
 24 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
 32 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
 40 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
 43 | ERROR   | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: civic_accessibility_toolbar/civic_accessibility_toolbar.module
-----------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AND 1 WARNING AFFECTING 11 LINES
-----------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] Missing file doc comment
  9 | ERROR   | [x] Opening brace should be on the same line as the declaration
 10 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 12 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
 13 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
 13 | ERROR   | [x] Concat operator must be surrounded by a single space
 13 | ERROR   | [x] Concat operator must be surrounded by a single space
 14 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 8
 15 | ERROR   | [x] Case breaking statement indented incorrectly; expected 6 spaces, found 8
 16 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 24 | ERROR   | [x] Opening brace should be on the same line as the declaration
 25 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 32 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------

Time: 68ms; Memory: 8MB

Translate with $this->t() line 13 and 14 on file civic_accessibility_toolbar.module

    switch ($route_name) {
    case 'help.page.civic_accessibility_toolbar':
        $output  = '';
        $output .= '<h3>'.t('About').'</h3>';
        $output .= '<p> Place the block into a region at Structure -> Block Layout</p>';
        return $output;
    }
avpaderno’s picture

    $form['colour_contrast'] = [
      '#type' => 'checkbox',
      '#title' => $this->t('Show colour contrast toolbar'),
      '#description' => $this->t('Check to show the colour contrast toolbar'),
      '#default_value' => isset($this->configuration['colour_contrast']) ? $this->configuration['colour_contrast'] : TRUE,
    ];

As side note, Drupal uses American spelling, in phrases shown to users. (It uses the American spelling for variables, functions/methods, and classes too.)

ralliaf’s picture

Thank you for the prompt review.
I fixed the reported issues and commited the code.

arturopanetta’s picture

LICENSE.txt is not required.

Your code does not include a license file and does not have comments indicating any other license than GPLv2+.
All projects hosted on Drupal.org are automatically licensed under GPLv2+, just as Drupal is itself. A copy of the GPL text (LICENSE.txt) will be added automatically for packaged downloads later.

Source of the quote: https://www.drupal.org/docs/develop/managing-a-drupalorg-theme-module-or-distribution-project/security-coverage/opting-in-1

ralliaf’s picture

Thank you again, LICENSE.txt is removed and removal is commited

avpaderno’s picture

Status: Needs work » Needs review
avpaderno’s picture

Assigned: Unassigned » avpaderno
Issue summary: View changes

I added the PAreview checklist link.
It doesn't report anything that's application blocker. The point about the used tag is wrong, since it doesn't consider Drupal.org now uses semantic versioning. The other point, which I find not much clear, just says that in line 8 ($output = '';) there are two spaces before the assignment operator instead of one.

I will make a manual review today.

avpaderno’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: project created less than ten days ago
  /**
   * {@inheritdoc}
   */
  public function access(AccountInterface $account, $return_as_object = FALSE) {
    $access = $this->blockAccess($account);
    return $return_as_object ? $access : $access->isAllowed('access content');
  }

That is the implementation already present in the BlockBase class, which uses BlockPluginTrait. What the block plugin should implement is blockAccess().

If the plugin doesn't require any special access check, please change the status back to Needs review. The access() method should be removed from that block plugin, but I don't consider this and the following application blockers.

  public function blockForm($form, FormStateInterface $form_state) {

    $form['text_resize'] = [
      '#type' => 'checkbox',
      '#title' => $this->t('Show text resize toolbar'),
      '#description' => $this->t('Check to show the text resize toolbar'),
      '#default_value' => isset($this->configuration['text_resize']) ? $this->configuration['text_resize'] : TRUE,
    ];

There should not be empty lines at the beginning of a function code.

bramdriesen’s picture

Assigned: avpaderno » Unassigned

I think you forgot to un-assign yourself @kiamlaluno

ralliaf’s picture

Status: Needs work » Needs review

Hello,
amendments based on last review comments are pushed to repository.
Thank you

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Needs review » Fixed

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, 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.

I thank all the dedicated reviewers as well.

ralliaf’s picture

Thank you all for your time and your guidance.

Status: Fixed » Closed (fixed)

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