Create Menu Item Type List All Categories
in Custom Adminmenu.
Error: The com_admin component's ACL configuration file is either missing or improperly structured.
Joomla! 3.7.0-staging
macOS Sierra, 10.12.3
Firefox 50.1.0
PHP 7.0.4
MySQLi 5.5.53-0
Labels |
Added:
?
|
I could not find a way to tell which components have categories, so I
displayed all. Do you have any suggestions?
@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.
@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
@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.
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.
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.
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 -"
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.
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?
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.
@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.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-01-30 13:36:18 |
Closed_By | ⇒ | franz-wohlkoenig |
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
@izharaazmi