-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Creating categories on the fly with numbers #25024
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.