Problem/Motivation

Once #3002316: Optionally show warning messages when referenced entities are being edited / deleted is resolved, the entity_usage module, will have options to show usage warning messages on entity edit and delete forms. So the custom warning message from paragraphs_library should be removed.

Proposed resolution

Remove the warning message and enable the messages in entity_usage on install and update the existing sites also.

Remaining tasks

User interface changes

API changes

Data model changes

Original report by [username]

Comments

arpad.rozsa created an issue. See original summary.

miro_dietiker’s picture

Status: Active » Postponed

I'm postponing this for the entity_usage dependency.

arpad.rozsa’s picture

Updated the patch according to the latest one in the entity_usage issue. Also added drupalci.yml to include the patch from that module, so this one can be tested.

johnchque’s picture

Status: Postponed » Needs work
+++ b/modules/paragraphs_library/paragraphs_library.install
@@ -45,6 +45,20 @@ function paragraphs_library_install() {
+  if (is_array($edit_warning_enabled) && !in_array('paragraphs_library_item', $edit_warning_enabled)) {
...
+  $delete_warning_enabled = $entity_usage_config->get('delete_warning_message_entity_types');

I think this is the problem why tests are not passing.

We should check if the result of edit_warning_enabled is empty or an array. When I installed paragraphs_demo, this was not enabled and it might be due to I didn't have any other entity type enabled in this setting.

[EDIT] While testing, I removed the is_array check and it seems that when installing for the first time, the setting returns null, maybe check if it is null too (?).

arpad.rozsa’s picture

Status: Needs work » Needs review
StatusFileSize
new9.06 KB
new2.71 KB

Thanks for the review. In the meantime I already noticed this problem so I updated the logic to work when there is no message enabled already.

miro_dietiker’s picture

Status: Needs review » Postponed

Looks pretty cool. Now we need to wait for Entity Usage to be ready.

arpad.rozsa’s picture

This might not be necessary, since it didn't introduce new changes to the main functionality, but I changed to the latest patch from the entity usage, just to be updated.

marcoscano’s picture

Status: Postponed » Needs review

For info, I just tagged alpha8 with #3002316: Optionally show warning messages when referenced entities are being edited / deleted included, so this could build on top of that.

berdir’s picture

Status: Needs review » Needs work

Great, thanks!

Means we need a new patch that doesn't apply the patch anymore and then we should be good to go.

miro_dietiker’s picture

Status: Needs work » Needs review
StatusFileSize
new7.61 KB

:-)

miro_dietiker’s picture

Status: Needs review » Fixed

Thus committed. Great to have this so much more clean. :-)

Status: Fixed » Closed (fixed)

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