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 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
Comment | File | Size | Author |
---|---|---|---|
#7 | new_message.png | 15.79 KB | batkor |
#7 | new_message.png | 27.24 KB | batkor |
Comments
Comment #2
drupal-ramesh CreditAttribution: drupal-ramesh as a volunteer and commentedHi 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
Comment #3
dgaspara CreditAttribution: dgaspara at NTT DATA commentedHi drupal.ramesh,
Thanks for your feedback. I changed manually all eol to LF, hope it works.
Comment #4
Ankush_03Hi 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.
Comment #5
apadernoComment #6
dgaspara CreditAttribution: dgaspara at NTT DATA commentedHi ankushgautam76@gmail.com,
Thanks for your feedback. I have fixed the error's listed above.
Comment #7
batkor1. 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.... ?
Comment #8
batkorComment #9
dgaspara CreditAttribution: dgaspara at NTT DATA commentedHi batkor,
Thanks for your feedback. I have fixed the markup errors listed above, could you please try it again?
Comment #10
batkorhi.
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: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
Comment #11
dgaspara CreditAttribution: dgaspara at NTT DATA commentedHi batkor,
Thank you so much for your detailed and valuable feedback. I committed the recommended changes.
Comment #12
batkor@dgaspara
Sorry, I meant remove your access handler and use hadnler from core.
Example:
Other problems not see.
Comment #13
dgaspara CreditAttribution: dgaspara at NTT DATA commentedHi batkor, done.
Comment #14
batkorReviewed & tested.
I don't see any problems
Comment #15
gaurav_manerkar CreditAttribution: gaurav_manerkar as a volunteer commentedLooks good to me
Comment #16
gaurav_manerkar CreditAttribution: gaurav_manerkar as a volunteer commentedComment #17
apadernoThank 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.