Conflicting Files ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
11 Jan 2020

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

Example with no filter

image

Example with category filter

image

Example with category and level filter

image

Example with TWO category filters and level filter

image

avatar brianteeman brianteeman - open - 11 Jan 2020
avatar brianteeman brianteeman - change - 11 Jan 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Jan 2020
Category Administration com_categories
avatar Quy
Quy - comment - 11 Jan 2020

Will this fix #22076?

avatar brianteeman
brianteeman - comment - 11 Jan 2020

It would help but its not the same thing

avatar brianteeman brianteeman - change - 11 Jan 2020
Labels Added: ?
avatar jwaisner jwaisner - test_item - 12 Jan 2020 - Tested successfully
avatar jwaisner
jwaisner - comment - 12 Jan 2020

I have tested this item successfully on 38241f7


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

avatar jwaisner jwaisner - test_item - 13 Jan 2020 - Tested successfully
avatar jwaisner
jwaisner - comment - 13 Jan 2020

I have tested this item successfully on 1694948


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

avatar sakiss
sakiss - comment - 13 Feb 2020

I have tested this item successfully on 1694948


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

avatar sakiss sakiss - test_item - 13 Feb 2020 - Tested successfully
avatar brianteeman brianteeman - change - 14 Feb 2020
Labels Added: Conflicting Files
avatar brianteeman
brianteeman - comment - 16 Feb 2020

drone errors are the usual flaky test and nothing to do with this pr

avatar Quy Quy - change - 21 Feb 2020
Status Pending Ready to Commit
avatar Quy
Quy - comment - 21 Feb 2020

RTC


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

avatar richard67
richard67 - comment - 25 Feb 2020

@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)?

avatar infograf768 infograf768 - change - 26 Feb 2020
Status Ready to Commit Pending
avatar infograf768
infograf768 - comment - 26 Feb 2020

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.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27486.
avatar infograf768
infograf768 - comment - 26 Feb 2020

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.

avatar infograf768
infograf768 - comment - 26 Feb 2020

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);
 	

Screen Shot 2020-02-26 at 09 33 18

avatar SharkyKZ
SharkyKZ - comment - 26 Feb 2020

@infograf768 Set the attribute in the model.

@brianteeman getStoreId() method in the model also needs to be updated.

avatar brianteeman brianteeman - change - 26 Feb 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-02-26 08:45:29
Closed_By brianteeman
avatar brianteeman brianteeman - close - 26 Feb 2020
avatar richard67
richard67 - comment - 26 Feb 2020

@brianteeman Why closing? Will you make a new PR instead?

Add a Comment

Login with GitHub to post a comment