?
avatar franz-wohlkoenig
franz-wohlkoenig
29 Jan 2017

Steps to reproduce the issue

Create Menu Item Type List All Categories in Custom Adminmenu.

Actual result

Error: The com_admin component's ACL configuration file is either missing or improperly structured.
screen shot 2017-01-29 at 8 51 35 am

System information (as much as possible)

Joomla! 3.7.0-staging
macOS Sierra, 10.12.3
Firefox 50.1.0
PHP 7.0.4
MySQLi 5.5.53-0

avatar franz-wohlkoenig franz-wohlkoenig - open - 29 Jan 2017
avatar joomla-cms-bot joomla-cms-bot - change - 29 Jan 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Jan 2017
avatar infograf768
infograf768 - comment - 29 Jan 2017

The issue is that you have chosen as component which does not have categories in the menu item.
It would be good to limit indeed the list displayed to the components which do.

For articles, I do not have any issue

screen shot 2017-01-29 at 09 29 18

@izharaazmi

avatar izharaazmi
izharaazmi - comment - 29 Jan 2017

I could not find a way to tell which components have categories, so I
displayed all. Do you have any suggestions?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 29 Jan 2017

@infograf768 Haven't looked at Choose a Component, so first one (Administrator - System Information" was taken. Now it works as i have chose an Component which have Caegories.

avatar infograf768
infograf768 - comment - 29 Jan 2017

@izharaazmi
The only clear difference I think of is in the access.xml (first check if it exists for the component) where one will have
<section name="category">

It anyway would need a new field type. I guess it should be based on the code from
/administrator/components/com_users/helpers/debug.php

avatar izharaazmi
izharaazmi - comment - 29 Jan 2017

@infograf768 https://github.com/infograf768 Ok, I'll look into that.

PS: Is it possible that I be "assigned" all those issues where a work from
me is expected or I've promised? I tend to request this so that I don't
lose track of any.

avatar mbabker
mbabker - comment - 29 Jan 2017

I wouldn't rely on the ACL for a component, what if someone builds a categories implementation but doesn't include ACL?

If I'm not mistaken though, it is basically a requirement to have a JCategories subclass if the component is using the core categories system. So that would probably be a more accurate check.

avatar Bakual
Bakual - comment - 29 Jan 2017

That likely will not be enough as well, since the extension may even consist of multiple parts. So if an extension uses multiple categories, it may have an extension parameter like "&extension="com_foo.bar".
The only reliable ways to detect valid extensions would be to have either a helper function returning them or quering the database to get the existing ones (assuming there is at least one category created for each type, which may not be the case)

The same issue would exist for com_fields, but that one for some reason isn't shown in the list of available menuitems. However there we would already have a helper method returning the valid contexts which could be used for that.

avatar infograf768
infograf768 - comment - 30 Jan 2017

In any case, to avoid the problem of the default top component being chosen (original report above), we should at least add an option select.

		<fields name="request">
			<field
				name="extension"
				type="components"
				label="COM_CATEGORIES_CHOOSE_COMPONENT_LABEL"
				description="COM_CATEGORIES_CHOOSE_COMPONENT_DESC"
				required="true"
			>
				<option value="">COM_MENUS_OPTION_SELECT_COMPONENT</option>
			</field>
		</fields>

with a new string
COM_MENUS_OPTION_SELECT_COMPONENT="- Select Component -"

@Bakual

quering the database to get the existing ones (assuming there is at least one category created for each type, which may not be the case)

If no category is created, then the menu item would be no use anyway. This looks like the easiest solution.

avatar izharaazmi
izharaazmi - comment - 30 Jan 2017

quering the database to get the existing ones (assuming there is at least one category created for each type, which may not be the case)

If no category is created, then the menu item would be no use anyway. This looks like the easiest solution.

Doesn't that leads to not allowing users to create any category for that extension too?

avatar infograf768
infograf768 - comment - 30 Jan 2017

doesn't that leads to not allowing users to create any category for that extension too?

I don't think so. The component would only display in the dropdown when there is a category.
testing some code now.

But I think the priority is really the component container for now. This one is not urgent.

avatar infograf768
infograf768 - comment - 30 Jan 2017

@Bakual @mbabker @izharaazmi @franz-wohlkoenig
#13808
Here is a possible patch. Yes, if no category is created, it will not show the component in the dropdown. Not a big deal imho.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 30 Jan 2017

Closing as we have #13808

avatar franz-wohlkoenig franz-wohlkoenig - change - 30 Jan 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-01-30 13:36:18
Closed_By franz-wohlkoenig
avatar franz-wohlkoenig franz-wohlkoenig - close - 30 Jan 2017

Add a Comment

Login with GitHub to post a comment