The Page Maintenance Mode module is very useful module. Site admin can put specific page into maintenance mode. Only site admin can see maintenance page. Using this module site admin can put multiple pages into maitenance mode and configure maintenance page message according to their requirement.

This module will create an admin configuration page.
admin/config/pagemaintenance/settings
This configuration page will have three option checkbox, page url and maintenance mode message.

Project link

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

Git instructions

git clone --branch 8.x-1.x git@git.drupal.org:project/page_maintenance_mode.git

Pareview checklist

https://pareview.sh/pareview/https-git.drupal.org-project-page_maintenan...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kuldeep.me created an issue. See original summary.

Pinesh Kumar’s picture

Issue summary: View changes
Pinesh Kumar’s picture

Thank you for the contribution!

Added a Pareview link into the issue summary.

1. Bad line endings were found, always use unix style terminators.

./page_maintenance_mode.info.yml: ASCII text, with CRLF line terminators
./config/install/page_maintenance_mode.settings.yml: ASCII text, with CRLF line terminators
./page_maintenance_mode.permissions.yml: ASCII text, with CRLF line terminators
config/install/page_maintenance_mode.settings.yml
page_maintenance_mode.info.yml
page_maintenance_mode.permissions.yml

2. Coder Sniffer has found some issues with your code.

FILE: .../vendor/drupal/pareviewsh/pareview_temp/page_maintenance_mode.module
--------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------
72 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found
| | 12
74 | ERROR | [x] Expected one space after the comma, 0 found
75 | WARNING | [x] A comma should follow the last multiline array item.
| | Found:
| | 'https://www.drupal.org/project/page_maintenance_mode'
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

3. DrupalPractice has found some issues with your code.

FILE: ...areviewsh/pareview_temp/src/Form/PageMaintenanceModeSettingsForm.php
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES
--------------------------------------------------------------------------
77 | WARNING | t() calls should be avoided in classes, use dependency
| | injection and $this->t() instead
81 | WARNING | t() calls should be avoided in classes, use dependency
| | injection and $this->t() instead
82 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
87 | WARNING | t() calls should be avoided in classes, use dependency
| | injection and $this->t() instead
89 | WARNING | t() calls should be avoided in classes, use dependency
| | injection and $this->t() instead
94 | WARNING | t() calls should be avoided in classes, use dependency
| | injection and $this->t() instead
95 | WARNING | t() calls should be avoided in classes, use dependency
| | injection and $this->t() instead
116 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
122 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
139 | WARNING | \Drupal calls should be avoided in classes, use
| | dependency injection instead
--------------------------------------------------------------------------

Pinesh Kumar’s picture

Status: Needs review » Needs work
KuldeepM’s picture

Status: Needs work » Needs review

I have fixed all warnings.

vuil’s picture

Issue summary: View changes
klausi’s picture

Status: Needs review » Needs work

Thanks for your contribution!

I was trying to test for XSS vulnerabilities but was not able to access the settings page: TypeError: Argument 4 passed to Drupal\page_maintenance_mode\Form\PageMaintenanceModeSettingsForm::__construct() must be an instance of Drupal\page_maintenance_mode\Form\AliasManagerInterface, instance of Drupal\Core\Path\AliasManager given. Can you clear that up and fix the use statements? Thanks!

vuil’s picture

Thanks for the contribution!

Please fix the following issues:

(1.)
Unknown AliasManagerInterface usage in __construct() method of class PageMaintenanceModeSettingsForm.
You maybe need to add one "use" statement more about.

(2.)

 ------ ---------------------------------------------------------------------------------
  Line   src\Form\PageMaintenanceModeSettingsForm.php
 ------ ---------------------------------------------------------------------------------
  40     Drupal\page_maintenance_mode\Form\PageMaintenanceModeSettingsForm::__construct() does not call parent constructor from Drupal\Core\Form\ConfigFormBase.
  40     Parameter $alias_manager of method Drupal\page_maintenance_mode\Form\PageMaintenanceModeSettingsForm::__construct() has invalid typehint type Drupal\page_maintenance_mode\Form\AliasManagerInterface.
 ------ ---------------------------------------------------------------------------------

@klausi Yes, it is. Both of us make a review separately with the same issue.

Sorry for the duplication. :)

KuldeepM’s picture

Status: Needs work » Needs review

I have fixed AliasManagerInterface issue.

phthlaap’s picture

Status: Needs review » Needs work

Please fix the issue reported by Drupal Check:

 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   src/Form/PageMaintenanceModeSettingsForm.php                                                                                                             
 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------- 
  41     Drupal\page_maintenance_mode\Form\PageMaintenanceModeSettingsForm::__construct() does not call parent constructor from Drupal\Core\Form\ConfigFormBase.  
 ------ --------------------------------------------------------------------------------------------------------------------------------------------------------- 

                                                                                                                        
 [ERROR] Found 1 error 
KuldeepM’s picture

Status: Needs work » Needs review

Fixed issue.

phthlaap’s picture

Status: Needs review » Needs work
FileSize
270.55 KB
165.13 KB

Thank you for fixing issues

1. Could you please remove empty else.
empty else

2. Could you please take a look this screenshot? Is there a wrong typing or something special in PHP?
php

apaderno’s picture

Status: Needs work » Needs review

$$entity_type_manager is correct PHP code, but in this case that is surely a typo for $entity_type_manager.

Thank you for the review, but we don't aim to point out every PHP errors/typos, except in cases such as the full file code being commented out, or the full code being outside functions/classes.

KuldeepM’s picture

I have fixed empty else & entity type manager typo issue.

S_Bhandari’s picture

Hi @KuldeepM,

I've reviewed your module and it works well for me. Also, Pareview.sh doesn't report any errors now.

Thanks,
Subhadeep

phthlaap’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for the contribution!

I have not found any security related issues into the code.

apaderno’s picture

Assigned: Unassigned » apaderno
Status: Reviewed & tested by the community » 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.

Status: Fixed » Closed (fixed)

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