Recalculate menu order on insertion or deletion#275
Recalculate menu order on insertion or deletion#275schlessera merged 4 commits intowp-cli:masterfrom
Conversation
|
Hi there @schlessera Any news on this PR being merged? Thanks |
|
Hi @petruchek, Yes, I'd like to move this forward. However, we'll need Behat tests for this first. Can you add tests to assert that the menu IDs are correctly modified? Let me know if you need assistance with writing the tests! |
@schlessera, thank you for your response. Could you please guide me a little, please? I'm assuming I need to modify features/menu-item.feature. Is this correct? Thank you for your time (very much) |
Yes, that's the one to edit.
Please create a separate scenario. In the existing tests, you can already see how the position is being represented in the output lists, so it should be relatively straight-forward to copy one of the existing scenarios and adapt it to test this PR. |
Hi there @schlessera, Is it something that still makes sense doing? Please let me know. |
|
Hey @petruchek, |
6652091 to
3a3b2a4
Compare
|
Thanks for the PR, @petruchek ! |
New private method called reorder_menu_items() which is being called after any menu item is being deleted or new menu item is being added and it has explicitly set position.
Issue reported and briefly discussed here: #493