Skip to content
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.1] Module "Articles - Categories" - Make the category selection optional #37116

Merged
merged 2 commits into from
Mar 17, 2022

Conversation

Bakual
Copy link
Contributor

@Bakual Bakual commented Feb 22, 2022

The module "Articles - Categories" requires to select a parent category. But that means you can't have the module show all categories, you can only show a subset.

I think this is a requirement which is not needed. The code itself already falls back to "root" if no category is selected.

Summary of Changes

Removing the "required" flag from the parent category field.

Testing Instructions

Test the module "Articles - Categories" and make especially sure nothing breaks when no category is selected.

Actual result BEFORE applying this Pull Request

You always need to select a category and the module shows only subset of the article categories.

Expected result AFTER applying this Pull Request

You don't need to select a category and the module can show all categories.

Documentation Changes Required

None

@chmst
Copy link
Contributor

chmst commented Feb 22, 2022

I have tested this item ✅ successfully on b8c2a08


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37116.

@brianteeman
Copy link
Contributor

I think the history on this code needs to be checked carefully. I'm sure there must be a reason. It is possibly related to multilingual

@Bakual
Copy link
Contributor Author

Bakual commented Feb 22, 2022

Good point. It looks like it got added just to use the modal_category formfield for J3.7. Before that, the field was not required.
See 45e14dd

@toivo
Copy link
Contributor

toivo commented Feb 23, 2022

I have tested this item ✅ successfully on b8c2a08

Tested successfully in Joomla 4.1.1-dev of 23 February in Wampserver 3.2.7 using PHP 8.0.15


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37116.

@Quy
Copy link
Contributor

Quy commented Feb 23, 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37116.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 23, 2022
@laoneo
Copy link
Member

laoneo commented Feb 23, 2022

Good point. It looks like it got added just to use the modal_category formfield for J3.7. Before that, the field was not required. See 45e14dd

Does the category form field still work as expected?

@Bakual
Copy link
Contributor Author

Bakual commented Feb 23, 2022

Why should it not work? I didn't change anything in the formfield.

@laoneo
Copy link
Member

laoneo commented Feb 23, 2022

But you are changing back something which was introduced on purpose. If that still works, then all is fine. Just wanted to double check before merging.

@brianteeman
Copy link
Contributor

But you are changing back something which was introduced on purpose.

which is a big red warning flag to me

@Bakual
Copy link
Contributor Author

Bakual commented Feb 23, 2022

I honestly doubt that it indeed was changed on purpose.
To me it looks more like copy-paste, because in other places it indeed has to be (and was before) required.
But here I couldn't find any issues with it being optional. And yep, of course the formfield can handle empty values.

Also, as I already wrote in the PR description, the code of the module already handles the case when no category is selected. I didn't had to change anything there.

@bembelimen bembelimen merged commit 1b7ba25 into joomla:4.1-dev Mar 17, 2022
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Mar 17, 2022
@bembelimen
Copy link
Contributor

Thx

@bembelimen bembelimen added this to the Joomla 4.1.1 milestone Mar 17, 2022
@Bakual Bakual deleted the 4_mod_articles_categories branch March 18, 2022 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants