User tests: Successful: Unsuccessful:
On a complex site with a lot of categories it can be very difficult to sort the categories using drag and drop because you cannot get the relevant tree on the same page.
This adds a new filter to com_category that allows you to select the parent category. It's particularly useful when used with the max levels filter.
Testing is easiest if you have the test sample data installed as that has a lot of categories
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_categories |
It would help but its not the same thing
Labels |
Added:
?
|
I have tested this item
I have tested this item
I have tested this item
Labels |
Added:
Conflicting Files
|
drone errors are the usual flaky test and nothing to do with this pr
Status | Pending | ⇒ | Ready to Commit |
RTC
@brianteeman I've just tested it before I wanted to merge but I've noticed something:
In categories list view for com_content everything works fine, but in categories list view for com_contact only categories of com_content are available for selection in the new categories filter field.
So it seems I always can select only com_content categories, regardless in which component's categories view I am.
I used testing sample data on current 4.0-dev.
Can you check and confirm or let me know if I'm doing something wrong?
And what is desired behavior of the new filter: Always be able to select from all categories, regardless of component (not nice), or should it be aware of the component and only offer suitable categories for the particular component for selection (perfect)?
Status | Ready to Commit | ⇒ | Pending |
I confirm the issue. Setting back to pending.
Note: I also have issue merging this PR in my local repo. Had to pick up the file from PR branch.
I guess the issue may be in the xml where the filter is limited to com_content
<field
name="category_id"
type="category"
label="JOPTION_SELECT_CATEGORY"
multiple="true"
extension="com_content". /// Limited to com_content
layout="joomla.form.field.list-fancy-select"
hint="JOPTION_SELECT_CATEGORY"
onchange="this.form.submit();"
published="0,1,2"
/>
But it looks also that the branch may not be up to date.
I propose to make the extension dynamic
<field
name="category_id"
type="category"
label="JOPTION_SELECT_CATEGORY"
multiple="true"
extension="dynamic"
layout="joomla.form.field.list-fancy-select"
hint="JOPTION_SELECT_CATEGORY"
onchange="this.form.submit();"
published="0,1,2"
/>
and
diff --git a/administrator/components/com_categories/src/View/Categories/HtmlView.php b/administrator/components/com_categories/src/View/Categories/HtmlView.php
index 2f1a431..275c322 100644
--- a/administrator/components/com_categories/src/View/Categories/HtmlView.php
+++ b/administrator/components/com_categories/src/View/Categories/HtmlView.php
@@ -127,4 +127,7 @@
}
+ $extensionName = $this->escape($this->state->get('filter.extension'));
+ $this->filterForm->setFieldAttribute('category_id', 'extension', $extensionName, 'filter');
+
return parent::display($tpl);
@infograf768 Set the attribute in the model.
@brianteeman getStoreId()
method in the model also needs to be updated.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-02-26 08:45:29 |
Closed_By | ⇒ | brianteeman |
@brianteeman Why closing? Will you make a new PR instead?
Will this fix #22076?