-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Position is not updated in wp menu item update command #463
Comments
Thanks for the report, @ernilambar ! This definitely seems like a bug. I was able to reproduce with the steps you provided. With this being said, I'm not sure it ever worked in the first place 🙃 Feel free to submit a pull request, if you'd like. Here is some guidance on our pull request best practices. |
I dug deeper into adding/updating menu item stuffs. Yes, this has not worked till now because when there is new position value, We have done only for
This |
Related: #493 |
Additional information about this issue. Slightly simpler reproduction stepsFirst, I was able to reproduce this issue with a slightly simpler command set by leaving off the Create the menu and items: wp menu create "Sample Menu"
wp menu item add-custom sample-menu Alpha https://alpha.com/
wp menu item add-custom sample-menu Beta https://beta.com/ Try to move Beta item to position 1: wp menu item update 5 --position=1 Show that Beta did not move: wp menu item list sample-menu --format=csv
db_id,type,title,link,position
4,custom,Alpha,https://alpha.com,1
5,custom,Beta,https://beta.com,2 New behavior discovered by moving first menu elementOddly enough, even though Beta cannot be moved to position 1, Alpha can be moved to position 2 wp menu item update 4 --position=2 wp menu item list sample-menu --format=csv
db_id,type,title,link,position
5,custom,Beta,https://beta.com,1
4,custom,Alpha,https://alpha.com,2 With Alpha in position 2, both Alpha and Beta can be moved freely:Move Beta to position 2: wp menu item update 5 --position=2 wp menu item list sample-menu --format=csv
db_id,type,title,link,position
4,custom,Alpha,https://alpha.com,1
5,custom,Beta,https://beta.com,2 Move Beta back to position 1 wp menu item update 5 --position=1 wp menu item list sample-menu --format=csv
db_id,type,title,link,position
5,custom,Beta,https://beta.com,1
4,custom,Alpha,https://alpha.com,2 However, once Alpha is moved back to position 1 Beta is again prevented from changing positionMove Alpha back to position 1: wp menu item update 4 --position=1 wp menu item list sample-menu --format=csv
db_id,type,title,link,position
4,custom,Alpha,https://alpha.com,1
5,custom,Beta,https://beta.com,2 wp menu item update 5 --position=1 Show that Beta did not move: wp menu item list sample-menu --format=csv
db_id,type,title,link,position
4,custom,Alpha,https://alpha.com,1
5,custom,Beta,https://beta.com,2 Edit: I see what's happening. The item update command is always updating the |
@ernilambar, is this still not fixed? I can see that some work was done in #502 but apparently it's not fully working. |
@petruchek Yah, not fixed. That approach did not work without breaking other things. Now in |
Bug Report
Describe the current, buggy behavior
Position is not updated in wp menu item update command.
Describe how other contributors can replicate this bug
wp menu create "Sample Menu"
wp menu item add-custom sample-menu Alpha https://alpha.com
wp menu item add-custom sample-menu Beta https://beta.com
wp menu item list sample-menu --format=csv
wp menu item update 1273 --link=https://beta.net --position=1
Describe what you would expect as the correct outcome
Position also should have been updated.
Let us know what environment you are running this on
The text was updated successfully, but these errors were encountered: