Fix 'menu_exists' response status code #34888
Merged
Conversation
4 of 7 tasks
$term->add_data( | ||
array( | ||
'status' => 400, | ||
'term_id' => $term_id, | ||
'term_id' => $existing_term->term_id, |
Mamaduka
Sep 16, 2021
Member
Suggested change
'term_id' => $existing_term->term_id,
'menu_id' => $existing_term->term_id,
Nit: Maybe we should use menu_id
here.
Suggested change
'term_id' => $existing_term->term_id, | |
'menu_id' => $existing_term->term_id, |
Nit: Maybe we should use menu_id
here.
) | ||
); | ||
} else { | ||
$term->add_data( array( 'status' => 400 ) ); |
Mamaduka
Sep 16, 2021
Member
This is great 🌟
This is great
Tested and works as expected I only left one minor suggestion. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Description
Alterative version of #34868
Menu REST API was returning response code 500 for menu already exists error. PR adjusts the check to set the status code correctly.
How has this been tested?
Screenshots
Types of changes
Bugfix
Checklist:
*.native.js
files for terms that need renaming or removal).