No Code Attached Yet Information Required
avatar boddunan
boddunan
19 Mar 2023

Steps to reproduce the issue

  1. Create a custom component with Joomla categories support
  2. Create site view for category with default.xml includes the category field name
    ex:
  3. Create a nested user group such as Registerd -> Parent Group -> Child Group
  4. Create a access level, say Child Access, to allow only Child group
  5. Go to your custom component categories page on backend and click on new button to create a category
  6. Create a category, say "Restricted Category" with the access level Child Access
  7. Go to Menus -> Menu -> Add Menu
  8. Select MyComponent -> Category menu item type
  9. The category dropdown do not show the Restricted Category.
  10. It does not show the category even if the access level of menu item is same

Expected result

The category Restricted Category is shown in the dropdown list of category form field.

Actual result

"Restricted Category" does not show

System information (as much as possible)

Joomla 3 & 4

Additional comments

avatar boddunan boddunan - open - 19 Mar 2023
avatar joomla-cms-bot joomla-cms-bot - change - 19 Mar 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 19 Mar 2023
avatar joomdonation
joomdonation - comment - 19 Mar 2023

@boddunan Can you try to re-procedure the issue with a Joomla core components which also uses Categories like com_content or com_contact ? We do not have access to your component, so it is hard for us to see the issue ourself to see what's wrong.

Also, in step 8 and step 9 which you described, normally, for core component, you will select a category from modal popup, not from a dropdown. Maybe that's the difference from how your component with core components.

avatar Quy Quy - change - 20 Mar 2023
Labels Added: Information Required
avatar Quy Quy - labeled - 20 Mar 2023
avatar boddunan
boddunan - comment - 21 Mar 2023

@joomdonation the issue is only with the category form field. Since the article category blog uses modal dialog, I do not see this issue.

avatar joomdonation
joomdonation - comment - 21 Mar 2023

Could you please attach the default.xml of your category so that we know exactly how you use that field ? Or better, use modal to allow selecting category like how we are doing it in the code.

avatar boddunan
boddunan - comment - 21 Mar 2023

Please find it below.

<?xml version="1.0" encoding="utf-8"?>
<metadata>
   <layout title="COM_MYCOMPONENT_CATEGORY_VIEW_DEFAULT_TITLE" option="COM_MYCOMPONENT_CATEGORY_VIEW_DEFAULT_OPTION">
   	<help key="JHELP_MENUS_MENU_ITEM_CATEGORY_LIST" />
   	<message>
   		<![CDATA[COM_MYCOMPONENT_CATEGORY_VIEW_DEFAULT_DESC]]>
   	</message>
   </layout>

   <!-- Add fields to the request variables for the layout. -->
   <fields name="request">
   	<fieldset name="request">
   		<field name="id" type="category" description="JGLOBAL_CHOOSE_CATEGORY_DESC" extension="com_mycomponent" label="JGLOBAL_CHOOSE_CATEGORY_LABEL" required="true" />
   	</fieldset>
   </fields>
</metadata>
avatar joomdonation
joomdonation - comment - 21 Mar 2023

By reading code quickly, that form field will only show categories which match the current user access levels. I guess we should modify code to exclude access level filter for users with core.admin permission

For the time being, please make sure the account you are to create menu item has the Child Access access level and the he will see the category.

avatar joomdonation
joomdonation - comment - 25 Mar 2023

@boddunan PR #40193 should address your issue. Could you please help testing? Thanks !

avatar joomdonation joomdonation - close - 25 Mar 2023
avatar joomdonation joomdonation - change - 25 Mar 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-03-25 14:10:36
Closed_By joomdonation

Add a Comment

Login with GitHub to post a comment