This module provides the ability to add multiple messages to content and media forms with multiple display options.
In the configuration page /admin/config/content/messages you can select:

  • Title (translatable)
  • Message and format (translatable)
  • Style: info, warning, error or plain
  • Weight: top, bottom or custom

and add it to multiple content or media types.

Project link

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

Git instructions

git clone --branch 8.x-1.x https://git.drupalcode.org/project/content_editing_message.git

CommentFileSizeAuthor
#7 new_message.png15.79 KBbatkor
#7 new_message.png27.24 KBbatkor
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dgaspara created an issue. See original summary.

drupal-ramesh’s picture

Hi dgaspara

Thanks for this nice module.

I found few coding standards erros and warnings .Please fix these drupal coding standards.

FILE: ...amp64\www\content_editing_message\content_editing_message.module
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: C:\wamp64\www\content_editing_message\css\message.css
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...nt_editing_message\src\ContentEditingMessageAccessController.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...w\content_editing_message\src\ContentEditingMessageInterface.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...ting_message\src\Controller\ContentEditingMessageListBuilder.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...www\content_editing_message\src\Entity\ContentEditingMessage.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...ontent_editing_message\src\Form\ContentEditingMessageAddForm.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...ent_editing_message\src\Form\ContentEditingMessageDeleteForm.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...ntent_editing_message\src\Form\ContentEditingMessageEditForm.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...ntent_editing_message\src\Form\ContentEditingMessageFormBase.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: C:\wamp64\www\content_editing_message\src\Form\DisableForm.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...ent_editing_message\tests\src\Unit\ContentEditingMessageTest.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 5.3 secs; Memory: 10MB

dgaspara’s picture

Hi drupal.ramesh,

Thanks for your feedback. I changed manually all eol to LF, hope it works.

Ankush_03’s picture

Hi dgaspara,

Thanks for your contribution !

Please check below issue :

311 Method
Drupal\content_editing_message\Form\ContentEditingMessageFormBase::sa
ve() should return int but return statement is missing.
------ -----------------------------------------------------------------------

------ ----------------------------------------------------------------------
Line src/Form/DisableForm.php
------ ----------------------------------------------------------------------
24 Property Drupal\content_editing_message\Form\DisableForm::$message
(Drupal\content_editing_message\ContentEditingMessageInterface) does
not accept Drupal\Core\Entity\EntityInterface.

apaderno’s picture

Status: Needs review » Needs work
dgaspara’s picture

Status: Needs work » Needs review

Hi ankushgautam76@gmail.com,

Thanks for your feedback. I have fixed the error's listed above.

batkor’s picture

FileSize
27.24 KB
15.79 KB

1. Please check message body render behavior (see attach files). Line for check https://git.drupalcode.org/project/content_editing_message/-/blob/8.x-1....
2. Maybe best use messanger interface constans?
See https://git.drupalcode.org/project/drupal/-/blob/9.0.x/core/lib/Drupal/C...
3. Remove this line https://git.drupalcode.org/project/content_editing_message/-/blob/8.x-1.... ?

batkor’s picture

Status: Needs review » Needs work
dgaspara’s picture

Status: Needs work » Needs review

Hi batkor,

Thanks for your feedback. I have fixed the markup errors listed above, could you please try it again?

batkor’s picture

hi.
1. Default value for checkboxs element should be array
https://git.drupalcode.org/project/content_editing_message/-/blob/8.x-1....
think you need returns empty array in object according to Interface see
https://git.drupalcode.org/project/content_editing_message/-/blob/8.x-1....
and this line not returns array if value empty.
https://git.drupalcode.org/project/content_editing_message/-/blob/8.x-1....
2. Check key exist in array.
https://git.drupalcode.org/project/content_editing_message/-/blob/8.x-1....
and add require options in form element https://git.drupalcode.org/project/content_editing_message/-/blob/8.x-1....

nitpick:
1. Use "factory method" for DI in https://git.drupalcode.org/project/content_editing_message/-/blob/8.x-1....

1.1 Remove __construct method.
1.2 Correct create method to:

 public static function create(ContainerInterface $container) {
   $instance = new static();
   $instance = $container->get('entity_type.manager');
   $instance = $container->get('module_handler');
    return $instance;
  }

2. Remove access handler ? (i'm not sure)
https://git.drupalcode.org/project/content_editing_message/-/blob/8.x-1....
Your acces handler empty if see https://git.drupalcode.org/project/content_editing_message/-/blob/8.x-1....

Other problems not see.
Thanks @dgaspara

dgaspara’s picture

Hi batkor,

Thank you so much for your detailed and valuable feedback. I committed the recommended changes.

batkor’s picture

@dgaspara
Sorry, I meant remove your access handler and use hadnler from core.
Example:

 *     handlers = {
 *       "access" = "Drupal\Core\Entity\EntityAccessControlHandler",

Other problems not see.

dgaspara’s picture

Hi batkor, done.

batkor’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed & tested.
I don't see any problems

gaurav_manerkar’s picture

Looks good to me

gaurav_manerkar’s picture

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.