? ? Pending

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
11 Feb 2020

When creating a new admin menuitem of the type "List All Categories", you need to select for which component the categories should be shown.
That list only shows categories where the extension field in the database is set to the component name. However categories can also have sections, eg instead of just com_foo that field then has com_foo.bar.
The current code will not let you select categories which have sections.

Summary of Changes

This PR changes the code to populate the option list so it works also for categories with sections.
For the naming, it follows loosely the logic we have in the categories manager itself. See

// If a component categories title string is present, let's use it.
if ($lang->hasKey($component_title_key = strtoupper($component . ($section ? "_$section" : '')) . '_CATEGORIES_TITLE'))
{
$title = Text::_($component_title_key);
}
elseif ($lang->hasKey($component_section_key = strtoupper($component . ($section ? "_$section" : ''))))
// Else if the component section string exits, let's use it
{
$title = Text::sprintf('COM_CATEGORIES_CATEGORIES_TITLE', $this->escape(Text::_($component_section_key)));
}
else
// Else use the base title
{
$title = Text::_('COM_CATEGORIES_CATEGORIES_BASE_TITLE');
}

Testing Instructions

To see a difference, you will need a component which uses categories with sections. Core doesn't use that but you can use my SermonSpeaker component (or any other that uses sections).
com_sermonspeaker.zip
For core itself, you should see no difference before and after this PR.

To test:

  • Create a custom admin menuitem of type "List All Categories"
  • Check the "Choose a Component" dropdown if you see all category types.

Expected result

image

Actual result

image

Documentation Changes Required

None

avatar Bakual Bakual - open - 11 Feb 2020
avatar Bakual Bakual - change - 11 Feb 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Feb 2020
Category Administration com_menus
avatar jwaisner jwaisner - change - 11 Feb 2020
Labels Added: ?
avatar alikon
alikon - comment - 14 Feb 2020

it's your component supposed to work only on mysql ?
i'm testing on postgresql ..... i know my fault ?
btw got this error
Screenshot from 2020-02-14 20-23-13

avatar Bakual
Bakual - comment - 14 Feb 2020

it's your component supposed to work only on mysql ?

Aye, only works with MySQL. I never bothered with other databases as I never got a feature request for that. Apparently the users of my component all use MySQL ?

avatar alikon
alikon - comment - 15 Feb 2020

I have tested this item successfully on a56297f


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

avatar alikon alikon - test_item - 15 Feb 2020 - Tested successfully
avatar jwaisner
jwaisner - comment - 15 Feb 2020

I have tested this item successfully on a56297f


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

avatar jwaisner jwaisner - test_item - 15 Feb 2020 - Tested successfully
avatar jwaisner jwaisner - change - 15 Feb 2020
Status Pending Ready to Commit
avatar jwaisner
jwaisner - comment - 15 Feb 2020

RTC


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

avatar Bakual Bakual - change - 15 Feb 2020
Labels Added: ?
avatar Bakual
Bakual - comment - 15 Feb 2020

Last commit was only a small CS change so test suite is happy ?

avatar rdeutz rdeutz - change - 16 Feb 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-02-16 08:46:40
Closed_By rdeutz
avatar rdeutz rdeutz - close - 16 Feb 2020
avatar rdeutz rdeutz - merge - 16 Feb 2020

Add a Comment

Login with GitHub to post a comment