? Failure

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
7 Jun 2017

Pull Request for Issue # .

Summary of Changes

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)

Testing Instructions

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

avatar joomdonation joomdonation - open - 7 Jun 2017
avatar joomdonation joomdonation - change - 7 Jun 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Jun 2017
Category Administration com_banners com_categories com_tags
3245956 7 Jun 2017 avatar joomdonation CS
avatar joomdonation joomdonation - change - 7 Jun 2017
Labels Added: ?
avatar laoneo
laoneo - comment - 7 Jun 2017

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.

avatar brianteeman brianteeman - change - 8 Jun 2017
Milestone Added:
avatar brianteeman brianteeman - change - 8 Jun 2017
Milestone Added:
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jun 2017
Category Administration com_banners com_categories com_tags Administration com_banners com_categories com_tags Libraries
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jun 2017
Category Administration com_banners com_categories com_tags Libraries Administration com_associations com_banners com_categories com_fields com_tags Libraries Modules Front End
8b4ce66 10 Jun 2017 avatar joomdonation CS
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jun 2017
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
69e49bc 10 Jun 2017 avatar joomdonation CS
avatar joomdonation
joomdonation - comment - 10 Jun 2017

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:

  1. 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

  2. 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?

avatar joomdonation joomdonation - change - 29 Sep 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-09-29 13:25:13
Closed_By joomdonation
avatar joomdonation joomdonation - close - 29 Sep 2017

Add a Comment

Login with GitHub to post a comment