[1.0.x] Media/Document Notifier

Created on 1 September 2023, 10 months ago
Updated 5 November 2023, 8 months ago

The Media Notifier module empowers Drupal administrators by email notifications whenever a new media or file is uploaded. Leveraging Drupal's SMTP settings, ensures timely alerts, making media management more efficient. It is ideal for those new to Drupal seeking an automated media upload notification system.

Project link

https://www.drupal.org/project/medianotify →

📌 Task
Status

Needs work

Component

module

Created by

🇺🇸United States mustafasayilan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mustafasayilan
  • 🇮🇳India vishal.kadam Mumbai

    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, you should run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
    • For the time this application is open, only your commits are allowed.
    • 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 and no other user will be able to opt projects into security advisory policy.
    • 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.
    • 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 → .

  • Issue was unassigned.
  • 🇮🇳India vishal.kadam Mumbai
  • Status changed to Needs work 10 months ago
  • 🇮🇳India vishal.kadam Mumbai

    1. main and 1.0.0 are wrong branch names, as branch names end with the literal .x. That branch needs to be removed.

    2. Fix phpcs issues.

    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml medianotify/
    
    FILE: medianotify/custom_email_notify.info.yml
    -----------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------
     1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
     1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
    -----------------------------------------------------------------------------------------------------------
    
    
    FILE: medianotify/custom_email_notify.module
    --------------------------------------------------------------------------------
    FOUND 24 ERRORS AND 6 WARNINGS AFFECTING 27 LINES
    --------------------------------------------------------------------------------
      1 | ERROR   | [x] Missing file doc comment
      4 | WARNING | [x] Unused use statement
      5 | WARNING | [x] Unused use statement
      5 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Mail\MailManagerInterface.
      6 | WARNING | [x] Unused use statement
      7 | WARNING | [x] Unused use statement
      8 | WARNING | [x] Unused use statement
      8 | ERROR   | [x] There must be one blank line after the last USE statement; 2 found;
     14 | ERROR   | [x] Expected 1 blank line before function; 2 found
     15 | ERROR   | [x] Opening brace should be on the same line as the declaration
     24 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 2
     25 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 2
     26 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 2
     27 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 4
     28 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 4
     29 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 4
     31 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 4
     32 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 2
     39 | ERROR   | [x] Expected 1 blank line before function; 2 found
     39 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
     40 | ERROR   | [x] Opening brace should be on the same line as the declaration
     51 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
     53 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced with use statements
     55 | ERROR   | [x] Expected newline after closing brace
     58 | ERROR   | [ ] The array declaration extends to column 124 (the limit is 80). The array content should be split up over multiple lines
     61 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     64 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     68 | ERROR   | [x] Expected 1 blank line after function; 2 found
     72 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
        |         |     xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
     75 | ERROR   | [x] Opening brace should be on the same line as the declaration
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 28 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: medianotify/src/Form/CustomEmailNotifySettingsForm.php
    --------------------------------------------------------------------------------
    FOUND 6 ERRORS AFFECTING 6 LINES
    --------------------------------------------------------------------------------
      8 | ERROR | [x] Missing class doc comment
      9 | ERROR | [x] Opening brace should be on the same line as the declaration
     15 | ERROR | [x] Opening brace should be on the same line as the declaration
     23 | ERROR | [x] Opening brace should be on the same line as the declaration
     31 | ERROR | [x] Opening brace should be on the same line as the declaration
     68 | ERROR | [x] Opening brace should be on the same line as the declaration
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    

    3. Replace README.txt with README.md and follow the guidelines.

    4. FILE: custom_email_notify.info.yml

    core_version_requirement: ^8 || ^9

    The Drupal Core versions before 8.7.7 do not recognize the core_version_requirement: key.

    package: Custom

    Modules should avoid using that value for the package.

    5. FILE: custom_email_notify.module

    /**
     * Implements hook_ENTITY_TYPE_insert() for media entities.
     */
    /*function custom_email_notify_media_insert(Media $media)
    {
      $file_id = $media->getSource()->getSourceFieldValue($media);
      $file = File::load($file_id);
      if ($file) {
        $uid = $media->getOwnerId();
        $user = \Drupal\user\Entity\User::load($uid);
        $username = $user->getAccountName();
    
        /*_custom_email_notify_send_email($file, $username);
      }
    }*/
    

    Remove commented code if not required.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    main is fine as branch name; Drupal core itself will use it. It is better to avoid it, for now, as there are still some issues that need to be fixed on drupal.org side, before main can effectively be used as branch name.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    I am changing priority as per Issue priorities → .

Production build 0.69.0 2024