User tests: Successful: Unsuccessful:
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_categories |
Labels |
Added:
?
|
Category | Administration com_categories | ⇒ | Administration com_categories Layout |
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.
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.
@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
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.
I can make new PR and delete this one.
Category | Administration com_categories Layout | ⇒ | Administration com_categories Layout Libraries |
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.
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.
@infograf768 So do it your way.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-05-08 10:36:37 |
Closed_By | ⇒ | artur-stepien |
@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
@infograf768 Thanks.
Hold on with the PR as I might found an issue with this.