Opened 7 years ago
Closed 7 years ago
#41894 closed defect (bug) (fixed)
Clear dirty flag on widgets admin screen when widget is deleted to prevent irrelevant “Are you sure?” prompt
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.9 | Priority: | high |
Severity: | normal | Version: | |
Component: | Widgets | Keywords: | has-patch commit |
Focuses: | javascript | Cc: |
Description (last modified by )
With [41352] for #23120 there is now an “Are you sure?” dialog that appears if you try leaving the widgets admin screen without first having saved a widget that you were modifying. This logic is not currently taking into account the scenario where by you delete a widget that you started making changes to. When a widget is deleted, any corresponding dirty flag also needs to be removed.
Attachments (3)
Change History (12)
#3
@
7 years ago
- Keywords good-first-bug removed
- Owner set to westonruter
- Status changed from new to accepted
#4
follow-up:
↓ 5
@
7 years ago
- Keywords needs-patch added; has-patch removed
@hazimayesh thank you for the patch. I made some stylistic changes in 41894.2.diff and also added a couple todos where I think additional dirty-flag clearing needs to be done. In particular, if you edit an inactive widget but then opt to click the “Clear Inactive Widgets” button then all of those widgets should get their dirty flags cleared. There's also another place where I can see a removal is happening but I'm not immediately aware of the scenario for when it will occur.
Would you like to make the additional changes to the patch?
#5
in reply to:
↑ 4
@
7 years ago
Replying to westonruter:
@westonruter. Thanks, I'm working to get rid of dirty flag the best way possible to prevent the scenario of inactive widgets.
#7
@
7 years ago
- Keywords has-patch added; needs-patch removed
I uploaded a patch with the necessary handling for inactive widgets.
The another place where you saw a removal happening, @westonruter, is the stop
event of sorting widgets: if it was being deleted, but the user was hovering it, that element should be removed when the movement stops. As it triggers wpWidgets.save
and we handle dirty states there, I think there is no need to check that again. Do you agree?
Bumping priority to high for visibility and alignment with 4.9 goals, and given proximity to beta 1 deadline.