? Pending

User tests: Successful: Unsuccessful:

avatar artur-stepien
artur-stepien
6 May 2020

Pull Request for Issue #28963 .

Summary of Changes

Just fixing the #28963

Testing Instructions

Look #28963

Expected result

Look #28963

Actual result

Look #28963

Documentation Changes Required

No

avatar artur-stepien artur-stepien - open - 6 May 2020
avatar artur-stepien artur-stepien - change - 6 May 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 May 2020
Category Administration com_categories
avatar artur-stepien
artur-stepien - comment - 6 May 2020

Hold on with the PR as I might found an issue with this.

avatar artur-stepien artur-stepien - change - 6 May 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 6 May 2020
Category Administration com_categories Administration com_categories Layout
avatar artur-stepien
artur-stepien - comment - 6 May 2020

Ok, it should be fine now. There was a missing root option in com_categories when used in com_categories itself. Now there is just a layout option for that thing if any of the extensions need a root option in the category batch pop-up. Also, in the batch pop-up I change JHtml to JLayout instead cause modifying JHtml function felt wrong.

avatar infograf768
infograf768 - comment - 6 May 2020

This does not work here. I don't get the language tag between parenthesis after the cat name.
Please add a screenshot of what you get (or want to get) after this PR.

avatar artur-stepien
artur-stepien - comment - 6 May 2020

@infograf768 Give me few hours. While adding missing "Add to root" option I removed the fix I made in the first place :D Need to find a solution to reconcile both of the fixes

avatar infograf768
infograf768 - comment - 8 May 2020

You are failing because the change is very simple and only concerns one file:

diff --git a/libraries/cms/html/category.php b/libraries/cms/html/category.php
index 413c246..0d7b76d 100644
--- a/libraries/cms/html/category.php
+++ b/libraries/cms/html/category.php
@@ -155,5 +155,5 @@
 			$db = JFactory::getDbo();
 			$query = $db->getQuery(true)
-				->select('a.id, a.title, a.level, a.parent_id')
+				->select('a.id, a.title, a.level, a.parent_id, a.language')
 				->from('#__categories AS a')
 				->where('a.parent_id > 0');
@@ -192,4 +192,10 @@
 				$repeat = ($item->level - 1 >= 0) ? $item->level - 1 : 0;
 				$item->title = str_repeat('- ', $repeat) . $item->title;
+
+				if ($item->language !== '*')
+				{
+					$item->title .= ' (' . $item->language . ')';
+				}
+
 				static::$items[$hash][] = JHtml::_('select.option', $item->id, $item->title);
 			}

In the screen shot below the only change is adding (xx-XX) after the name as I already added in some of the categories names the lang tag.

Screen Shot 2020-05-08 at 09 07 31

I can make new PR and delete this one.

avatar joomla-cms-bot joomla-cms-bot - change - 8 May 2020
Category Administration com_categories Layout Administration com_categories Layout Libraries
avatar artur-stepien
artur-stepien - comment - 8 May 2020

Yeah, that was the missing part to keep both changes. But now I'm interested if there is a point to keep both category.options and category.categories cause they both seems to do the same. but with or without root item.

avatar infograf768
infograf768 - comment - 8 May 2020

I would not merge this PR.
The change I proposed is enough. Not necessary to modify other files.
If you want to refactor totally this feature, please propose it for 4.0.

avatar artur-stepien
artur-stepien - comment - 8 May 2020

@infograf768 So do it your way.

avatar artur-stepien artur-stepien - close - 8 May 2020
avatar artur-stepien artur-stepien - change - 8 May 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-05-08 10:36:37
Closed_By artur-stepien
avatar infograf768
infograf768 - comment - 9 May 2020

I created the PR #29003

I suggest you make a specific PR for the rest vs J4

avatar infograf768
infograf768 - comment - 13 May 2020

@artur-stepien
I will make specific PR for J4 using your code adapted to J4 as layout helpers are used for all batch and there are no specific differenciation between category.categories and category.options

avatar artur-stepien
artur-stepien - comment - 13 May 2020

@infograf768 Thanks.

avatar infograf768
infograf768 - comment - 13 May 2020

Can be tested here
#29053

Add a Comment

Login with GitHub to post a comment