-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[4.0] Support to set the location when saving a category through the API #36318
[4.0] Support to set the location when saving a category through the API #36318
Conversation
i guess we should do the same for endpoint POST |
I have tested this item ✅ successfully on b51641d This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36318. |
@alikon if accepted, then I can do also for menus. |
While testing this it seems that api can by-pass the alias naming restrictions is this intended?
executing this command 2 times ends, in one item before and one (the second call) as last item... I know unrelated to this PR... What the rest is working find but could we get some variable validation in this function because passing location and location_reference without input validation is wrong. |
Validation is done on the model level, so there is no reason to do it on the controller level as well. So if there is something missing on the validation side, it must be fixed in the model. But I casted to int in the controller to be double save. |
@HLeithner can you mark your test as successful please. |
I have tested this item ✅ successfully on 323a846 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36318. |
1 similar comment
I have tested this item ✅ successfully on 323a846 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36318. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36318. |
Thanks! |
Summary of Changes
This PR adds the possibility to define the location of the category while saving it through the API. A location can be one of the following values:
If
before
orafter
is used it is advisable to also set the location_reference parameter which defines the sibling the category should be located.Testing Instructions
Run the following curl command:
Actual result BEFORE applying this Pull Request
The new category appears as last item in the list in the back end UI.
Expected result AFTER applying this Pull Request
The new category appears as first item in the list in the back end UI.
Documentation Changes Required
The new
location
andlocation_reference
arguments need to be documented.