User tests: Successful: Unsuccessful:
Pull Request for Issue # .
In Joomla 4.0, we namespaced all of our components. However, for helper classes, we had to keep these classes none-namespace because these classes have methods use by other components.
As a result, we have both namespace and none-namespace helper classes in the same component, it is not nice.
This PR shows an idea to solve it. If an extension has namespace helper class, this namespace class will be used, otherwise, the none namespace class will be used.
For this one, I starts with CategoriesHelper class (addSubmenu method), Categories model and Tags model (method countItems)
I am not sure if this will be accepted, so for now, open for discussion only. If the idea is accepted, just test banners component (backend) and make sure it is still working
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_banners com_categories com_tags |
Labels |
Added:
?
|
Milestone |
Added: |
Milestone |
Added: |
Category | Administration com_banners com_categories com_tags | ⇒ | Administration com_banners com_categories com_tags Libraries |
Category | Administration com_banners com_categories com_tags Libraries | ⇒ | Administration com_associations com_banners com_categories com_fields com_tags Libraries Modules Front End |
Category | Administration com_banners com_categories com_tags Libraries com_associations com_fields Modules Front End | ⇒ | Administration com_banners com_categories com_fields com_tags Libraries |
I tried to have only single method to get all types of component helper classes but failed due to inconsistent naming convention of those helper classes
So for now, I only start with the component main helper file. It has two benefits:
Allows us to remove blank none-namespace helper class like this https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_banners/helpers/banners.php#L17
Remove the same repeating code which do the same things in different components (com_categories. com_tags, com_fields)
If the concept is accepted, we can do the same with other helper classes so that we can have all of those helper classes namespaced. I know Allon doesn't like this, could I have feedback from others?
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-09-29 13:25:13 |
Closed_By | ⇒ | joomdonation |
Honestly I would prefer a more service oriented approach. In Krakow we have been discussing something with events. I just don't like this idea of magic class path set up.