Currently, when I create a new context, I see the message

The context %label has been added.

When I change and save an existing context, i don't see any message and the page just appears to reload.

This patch fixes that by adding a status message when saving existing contexts and routs the user to the list/collection page.

Comments

rjjakes created an issue. See original summary.

rjjakes’s picture

Updated patch credit.

alecsmrekar’s picture

Status: Needs review » Reviewed & tested by the community

Seems to work fine.

boshtian’s picture

Status: Reviewed & tested by the community » Needs work

The patch works, but I would further discuss the functionality.

If I would be editing context, I'm not sure that I want to be redirected back to the context list by default.

What I suggest is to add two separate submit actions, with 'Save and continue' and 'Save and exit' labels. The button should look like a "dropbutton", the one Drupal 8 is using on creating node (Save and publish, Save as unpublished).

maaty388’s picture

Status: Needs work » Needs review
StatusFileSize
new1.51 KB

I made changes based on the previous patch. Now we have 2 submit buttons grouped together in one "drop-down button", one is named "Save and exit", which saves entity and redirect to the collection route. Another one is named "Save and continue", which just saves the entity.

maaty388’s picture

StatusFileSize
new1.46 KB

I just removed weight for save buttons and changed "Save and Continue" to "Save and continue".

icurk’s picture

Status: Needs review » Needs work

Nice patch. I think that #6 patch solution is better than #2. It would be nice if on save we show a message to a user that a context was saved. So basically just merge #6 and #2 patch.

maaty388’s picture

Merged #6 and #2 together so now it also displays status message

maaty388’s picture

Status: Needs work » Needs review
maaty388’s picture

Fixed patch because I edited patch instead of code (removed comment)

boshtian’s picture

Status: Needs review » Reviewed & tested by the community

It looks good now. Thank you all for the contribution.

  • matjaz_zavski authored 12a69aa on 8.x-1.x
    Issue #2877371 by matjaz_zavski, rjjakes, icurk: When saving an entity,...
boshtian’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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