Page MenuHomePhabricator

Same Category get added multiple times ,for every change in “Sort this page by default as” value.
Closed, ResolvedPublic8 Estimated Story Points

Description

Environment- test2, beta

1>Select Page Options -> Categories
2> Add a category and click on the indicator-down arrow.
3> In the resulting pop up enter a name in the “Sort this page as if it is called” input field. Hit enter to set the value.
4> For the same category, click on the drop-down arrow again and in the resulting pop up enter a different name in the “Sort this page as if it is called” input field. Hit enter to set the value.
5>Click on the drop down arrow again.
6>Click Cancel.
7> Select Page Options -> Categories.Notice the same Category has been added multiple times, with different “sort this page as if it is called” values. See screencast.

Browser- Chrome39, FF33.1.1


See Also:
T54238
T52120
T89618
T56169

Event Timeline

Swainr raised the priority of this task from to Medium.
Swainr updated the task description. (Show Details)
Swainr changed Security from none to None.
Swainr subscribed.

I can reproduce it, both in beta and test2. The step#5 is the key.

Reproducible in beta ad test2 - but multiple categories do not get saved, so the bug is minor.

Steps(simplified):

  1. VE - Categories - click on a drop down for an existing category and enter some value. Hit Enter(important!).
  2. Click Cancel.
  3. Open Categories again - there will be two instances of the category displayed.

Yep, managed to reproduce this now. Thanks.

This appears to be due to MWCategoryWidget#addItems using promises (the parent GroupElement#addItems does not really support this) - that callback may finish running after the user has already cancelled and reopened the categories dialog.

Jdforrester-WMF claimed this task.
Jdforrester-WMF subscribed.

This seems to now be fixed?

I can still reproduce it,the steps to reproduce are same as above.See screenshot.

s0.PNG (187×701 px, 8 KB)

Yes, I would be surprised if this silently fixed itself.

OK, I ran through the exact instructions given above in both Chrome 39 and Firefox 35, and couldn't replicate. Could you tell me how to replicate it now?

I can't reproduce either, but the buttons definitely act funny, visibly disappearing and reappearing when the popup closes. Some refactoring probably wouldn't hurt and just might fix this issue.

Steps-:
1> Select Categories
2> Add a category(one which lacks a description page. When added, category name would be in red font color)
3> Click on the indicator-down arrow.In the resulting pop up enter a name in the “Sort this page...” input field. Hit enter to set the value.
4> For the same category, click on the drop-down arrow again and in the resulting pop up enter a different name in the “Sort this page ....” input field. Hit enter to set the value.
5> Click on the drop-down arrow .
6> Click Cancel.
7> Select Categories.The category has been added multiple times.

Screencast at http://youtu.be/cVLFH4QOMzU.

Oooh, the big dialog's "Cancel" button. I can reproduce now.

This now seems fixed-ish (no duplication of the category), but the newly-added-categories are still retained in the dialog (but not inserted) if you cancel the dialog. Instead, on setup the dialog should clear any new-and-not-yet-put-into-the-document categories.

I can't reproduce this now. I followed the exact steps in the screencast and the category dialog ends up empty. As it should, since I clicked cancel. If I click apply changes instead, only one category is saved. I didn't manage to reproduce duplication anywhere.

Perhaps one of Alex's recent changes fixed this?