-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring com_fields to no longer use com_categories #13019
Conversation
General cleanup
* | ||
* @return boolean | ||
* | ||
* @since 1.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEPLOY_VERSION
??
(Just to prove i read the code ;) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix. Thanks!
'type', 'a.type', | ||
'alias', 'a.alias', | ||
'state', 'a.state', | ||
'access', 'a.access', 'access_level', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elsewhere you have put access_level on its own row in the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't really matter, but for consistency (since I like that myself as well) I will change it.
Looking closer That in itself is NOT a problem |
Actually that is intented behaviour, but something which can be discussed if we want it or not. The URL doesn't need the context/extension anymore after it is initially set. So if you click the link in the sidebar, you see the extension/context in the URL. It will then set the userstate and from there on it's not needed anymore. If you use the dropdown, the extension/context will be sent in the form (POST) and not in the URL (GET). So that is fine. |
The sidebar also changes, but I agree it may not be noticed. |
Direct links should work imho. The sidebar and menu links doen't do anything else and they work fine as far as I tested. |
they will if you copy the one that has the full context in. They wont if you use the url you see when you use the switcher as seen in the video |
Yep, that's true. Not sure how important it is. It may be a bit tricky to do and likely involves JavaScript if you want to change the URL from a select. I think in current staging it's done using JS. |
IMO it will be confusing for the end user to have all of the sudden an option to switch between components. In Joomla we don't have such functionality nowhere, so I would not introduce it. I would also do it the way that when there is only one context in the component, that the field will be hidden at all. |
To be fair, the only place where we currently have a similar cross-extension extension is com_categories. That one doesn't have such a select, that's true. You could look at it as a required option to filter fields. Like the search filters but not optional. |
I would remove it.
|
I can't find a use case where you are working on custom fields for articles and then you need to switch to the custom fields of users. |
I can think of use cases when you're setting up a site. |
Removed the switcher from groups view and only show it in fields view when there is more than one context. |
Also wrong context com_content.article on attempting to create a field under com_users. |
@ralain Thanks for the test, the first one is indeed because there is an empty "&extension=" in the URL. I have to see where that comes from. The other is strange. |
@ralain I think I have found the culprits. Can you please test again? |
Yep, I am now able to create fields under com_users, and apart from the "field deleted" message, the rest appears to be fixed as well. |
Fixed the message as well. |
I have tested this item ✅ successfully on c4becd9 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13019. |
I have tested this item ✅ successfully on c4becd9 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13019. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13019. |
@Bakual Thank you for leading me to this PR. IMO i think such approach is better and more logical (and extendable later). Any thoughts? |
Isn't there an open issue somewhere for this? While I'm here, I'd say the way it is now is fine. It's also consistent with how categories are handled for extensions supporting those. Or are you saying you'd rather those all moved in favor of a categories item too? Fields is integrated on a per-extension basis. For me that means I'd look for it with the extension. |
For me it clutters the menu and doesn´t leave space for future improvements. Like that it would be isolated as an own area to build custom forms for any extension that supports it... It´s more tidy, no? |
You might be able to pull it off with your own custom admin menu. But the way core handles things, it's too complex to do that by default. I honestly see the number of top level menus as clutter and adding one more makes it worse. |
This should be discussed in an own issue, not in a merged PR. I just linked it because it was discussed here already before the current state got merged.
The issue arose because there is another PR now which may raise those field links in the sidebar from currently two to three. It's not one single link like for categories. |
This is a bigger refactoring of com_fields to get rid of the use of com_categories for its field groups (fieldset) feature.
During the rewrite I found also several code pieces which are unused or were copy-pasted from com_categories but don't make sense in the context of fields.
I also replaced the useage of some deprecated methods.
So forgive me that it become a bit bigger than initially planned 😄
Summary of Changes
Testing Instructions
Documentation Changes Required
If there already is documentation how to implement com_fields into an extension, that will need to be adjusted.