Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This module sends out a notification when the site is set to maintenance mode or set back to live from maintenance.
Features of this module
- Sends out a mail to the selected user emails when put in maintenance mode.
- Sends out a mail to the selected user emails when removed from maintenance mode.
- Can select a different email templates for both the above scenarios
Project page: https://www.drupal.org/sandbox/sandeepreddyg/2745699
Git url: git clone --branch 8.x-1.x https://git.drupal.org/sandbox/sandeepreddyg/2745699.git maintenance_notifications
PAreview: http://pareview.sh/pareview/httpsgitdrupalorgsandboxsandeepreddyg2745699...
Reviews for Other Projects:
https://www.drupal.org/node/2603436#comment-11327869
https://www.drupal.org/node/2706919#comment-11328187
https://www.drupal.org/node/2804009#comment-11652335
Comment | File | Size | Author |
---|---|---|---|
#9 | Screenshot from 2016-06-29 15:25:08.png | 21.11 KB | poojasharmaece |
#4 | unable-to-save-settings.png | 101.28 KB | Anonymous (not verified) |
#2 | Screenshot from 2016-06-17 14-13-18.png | 24.68 KB | sandeepguntaka |
Comments
Comment #2
sandeepguntaka CreditAttribution: sandeepguntaka at Azri Solutions commentedComment #3
PA robot CreditAttribution: PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer commentedHi sandeepreddyg! First off, I think this is a great idea for a module. Below is a list of issues I came across when trying to use it.
Missing Folder Name in Git Url:
In the issue description where you put the Git clone command the folder name was missing from the end of the command. Because of that when I used the command the folder name was '2745699'. I've gone ahead and updated the description for you.
Add Module Descriptions:
It's best practice to make sure your module has a good description so that people know exactly what it does when installing it. You should go ahead and add a description to line 3 of your "maintenance_notifications.info.yml" file and line 3 of your "maintenance_notifications.links.menu.yml" file.
Add a Configuration Link:
Since the module has a configuration page you should add it to the "maintenance_notifications.info.yml" file using the "config". For your module I think you would add "config: maintenance_notifications.form".
Message Typos:
These are just small grammar issues that could be improved.
Unable to Save Settings:
When I tried to save my custom notification settings I got an error that said, "Below highlighted Fields are required". All of the fields are highlighted red even though I did fill them out. I've attached a screenshot here.
I hope this helps!
Comment #5
sandeepguntaka CreditAttribution: sandeepguntaka at Azri Solutions commentedThanks for reviewing @keeganhr. I ve commited the suggested changes.
Comment #6
sandeepguntaka CreditAttribution: sandeepguntaka at Azri Solutions commentedComment #7
sandeepguntaka CreditAttribution: sandeepguntaka at Azri Solutions commentedComment #8
visabhishek CreditAttribution: visabhishek as a volunteer and at Azri Solutions commentedHi sandeepreddyg,
Module looks good. Some suggestions are :
1: Follow the Readme template for the readme.txt https://www.drupal.org/node/2181737
2: Please add configuration and permission links in info file.
3: Add hook_help().
4: To find configure link is difficult So You can add a local.task for maintenance "base_route:admin/config/development/maintenance"
Comment #9
poojasharmaece CreditAttribution: poojasharmaece as a volunteer and commentedHi sandeepreddyg,
I tried to test your module , Its working fine only one functionality is not working which is
1: Not accepting multiple emails on configuration form, Please see the attachement
Comment #10
sandeepguntaka CreditAttribution: sandeepguntaka at Azri Solutions commentedThanks for the reviews @visabhishek and @poojasharmaece. The things are fixed and commited.
Comment #11
sandeepguntaka CreditAttribution: sandeepguntaka at Azri Solutions commentedComment #12
anavarreIn
maintenance_notifications.info.yml
you don't need:In
maintenance_notifications.permissions.yml
You can drop
description: 'Configration Maintenance Notification'
completely as it doesn't bring any different help message than the permission title.Also, I think your permission machine name is wrong either in this file or in
maintenance_notifications.routing.yml
which has_permission: 'administer maintenance_notifications'
In
maintenance_notifications.module
In
hook_help()
You have a typo line 19:
maintennance
->maintenance
You can drop
default:
altogether (line 22)Your parameters for
hook_form_FORM_ID_alter()
are wrong (D7, not D8). See https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Form%21fo...In
hook_mail()
, you should not invokeDrupal\Component\Utility\SafeMarkup
directly. Instead, having a use statement at the top of the file would be recommended. AlsoSafeMarkup
is deprecated so you should consider replacing it.In
MaintenanceNotification.php
Perhaps you could replace
valid_email_address($maintenance_user)
by\Drupal::service('email.validator')->isValid($maintenance_user)
Also, in
submitForm()
, you could simplify your code. E.g.Could become:
Comment #13
poojasharmaece CreditAttribution: poojasharmaece as a volunteer and commentedHi sandeepreddyg,
In updated code when i am putting my site in maintenance i am not getting any mail or messages. (I checked on Screen and logger both places.
And i am getting following error : "The website encountered an unexpected error. Please try again later."
Error log message is :
Error : Recoverable fatal error: Object of class Drupal\\Core\\Language\\Language could not be converted to string in /var/www/html/drupal-8/core/lib/Drupal/Core/StringTranslation/Translator/CustomStrings.php on line 37, referer: http://localhost/drupal-8/admin/config/development/maintenance
Please correct me , if i am doing something wrong.
Thanks
Comment #14
sandeepguntaka CreditAttribution: sandeepguntaka at Azri Solutions commented@poojasharmaece Thanks for review again, The issue is now fixed. Please have a check now. @anavarre I Thanks for the suggestions. I've implemented them now, please make some time to review.
Comment #15
poojasharmaece CreditAttribution: poojasharmaece as a volunteer and commentedI think we don't have any blockers now. So i am marking as RTBC.
Comment #16
anavarreThanks for the quick fixes, @sandeepreddyg.
One nitpick I have is you could
use Drupal\Core\Form\FormStateInterface;
to invokeFormStateInterface $form_state
instead of\Drupal\Core\Form\FormStateInterface $form_state
inhook_form_FORM_ID_alter()
- Also, it's missing a whitespace between the 1st and 2nd parameters.Comment #17
sandeepguntaka CreditAttribution: sandeepguntaka at Azri Solutions commented@anavarre Thanks for reviewing again. I've added them to the code.
Comment #18
sandeepguntaka CreditAttribution: sandeepguntaka at Azri Solutions commentedComment #19
apadernoI will update your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. 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.
Thanks go the dedicated reviewer(s) as well.
Comment #20
sandeepguntaka CreditAttribution: sandeepguntaka at Azri Solutions commentedThanks for the update @kiamlaluno