Creating categories on the fly with numbers#25024
Creating categories on the fly with numbers#25024HLeithner merged 11 commits intojoomla:stagingfrom SharkyKZ:j3/categoriesOnTheFly
Conversation
|
On second thought this could be a B/C break for those programatically adding articles using the model. If using category title, it must now contain |
|
Should be OK now. |
|
I have tested this item ✅ successfully on 4cf418c This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25024. |
1 similar comment
|
I have tested this item ✅ successfully on 4cf418c This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25024. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25024. |
|
@bembelimen can you confirm that this fix your problem? |
|
|
||
| // Save New Category | ||
| if ($catid == 0 && $this->canCreateCategory()) | ||
| if ($createCategory && $this->canCreateCategory()) |
There was a problem hiding this comment.
In general the PR solves the problem, thank you @SharkyKZ very good work.
I have one general thought here (which I'm not sure if related to this PR or needs a new one):
Let's assume we transfer a string as catid (so $createCategory is true) but $this->canCreateCategory() is false, what is the saved value for catid then? I assume "0"?
So tltr: PR is fine imho and can be merged. If this special (edge) case would also be handled, it would be nice, too.
There was a problem hiding this comment.
The UI wouldn't allow to create category, but if you circumvent it, the ID would be 0. It's the same before this PR though.
|
thx |
|
Sorry I just came across this. Isn't this a b/c break for people using com_categories because they need to change their models (like we had to in com_content). I think the component specific ones in banners and contact is fine) but not the com_categories one which is generic |
|
@wilsonge No, the custom prefix property added to |
|
OK makes sense - missed that - thanks! |
Pull Request for Issue #22216.
Summary of Changes
Adds prefix to categories created on the fly to allow creating categories starting with numbers.
Testing Instructions
Expected result
A new category is created and assigned to the article
Actual result
The old category from 1 is assigned
Documentation Changes Required
New
Categoryeditfield property added.Categories created on the fly contain
#new#prefix.