Problem/Motivation

When submitting the configuration form at admin/config/content/entity_browser/FOOBAR/edit or admin/config/content/entity_browser/FOOBAR/widgets, no confirmation message appears. A minor but still.

Proposed resolution

Add a message that confirms that settings were changed.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Primsi created an issue. See original summary.

oknate’s picture

Status: Active » Needs review
FileSize
1.37 KB
Primsi’s picture

Status: Needs review » Needs work

Thanks. Maybe we could use the messenger service, given that it's already available in entity forms.

oknate’s picture

Here are three patches that use the messenger service.

1) First one just uses messenger trait, which will call \Drupal::messenger()

2) Second one injects messenger service into the two forms

3) Third one replaces drupal_set_message() throughout the entity_browser module.

Status: Needs review » Needs work
oknate’s picture

Status: Needs work » Needs review
FileSize
15.01 KB

Fixing v3.

oknate’s picture

Component: Miscellaneous » User interface
FileSize
19.59 KB

Adding test coverage.

oknate’s picture

Primsi’s picture

Status: Needs review » Needs work
+++ b/src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php
@@ -401,6 +406,9 @@ class EntityReferenceBrowserWidget extends WidgetBase implements ContainerFactor
+    if (empty($element['#attached']['drupalSettings']['entity_browser'])) {
+      return $element;
+    }

Seems unrelated?

Apart from that seems quite ok to me. Tested this manually, worked quite alright.

oknate’s picture

Status: Needs work » Needs review
FileSize
915 bytes
19.24 KB

Updated.

oknate’s picture

Running test against 8.x-1.x branch.

Primsi’s picture

Status: Needs review » Reviewed & tested by the community

  • oknate committed 523b363 on 8.x-2.x
    Issue #3038292 by oknate: Adding confirmation message after saving...

  • oknate committed 8353d87 on 8.x-1.x
    Issue #3038292 by oknate: Adding confirmation message after saving...
oknate’s picture

Committed. Thanks for the idea/review, Primsi.

oknate’s picture

Status: Reviewed & tested by the community » Fixed
oknate’s picture

Status: Fixed » Needs work

Looks like I introduced a minor bug:
https://www.drupal.org/pift-ci-job/1234548

FormBase already has MessengerTrait.

class FormElementTest extends FormBase {

  use MessengerTrait;
oknate’s picture

Status: Needs work » Needs review
FileSize
491 bytes
Primsi’s picture

Status: Needs review » Reviewed & tested by the community

Good catch.

  • oknate committed 7644b4e on 8.x-2.x
    Issue #3038292 by oknate: Removing redundant use statement
    

  • oknate committed 1b7f33f on 8.x-1.x
    Issue #3038292 by oknate: Removing redundant use statement
    
oknate’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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