? Failure

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
12 Jun 2017

Summary of Changes

Namespaces JHtml class and adds the possibility to add class prefixes to look for. Similar to what we did for JForm in #15893.

To showcase the whole thing the JHtmlJqueryclass got namespaced and com_content on the front and back end.

When merged, then I will port it back to the 3.8 branch.

Testing Instructions

  • Edit an article on the back end
  • Save and close
  • Open the article on the front end

Expected result

  • In the back end is jquery correctly loaded from the vendor directory when editing an article.
  • The back end article lists shows the featured images/icons.
  • On the front are the icons displayed to mail an article

Actual result

  • jQuery is not loaded.
  • The rest is working with the none namespaced code, but nothing is broken.

Documentation Changes Required

How to register class prefixes needs to be documented.

avatar laoneo laoneo - open - 12 Jun 2017
avatar laoneo laoneo - change - 12 Jun 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Jun 2017
Category Administration com_content Front End Libraries
avatar laoneo laoneo - change - 12 Jun 2017
Labels Added: ?
88ce736 12 Jun 2017 avatar laoneo cs
avatar laoneo
laoneo - comment - 1 Jul 2017

Any feedback here?

avatar brianteeman brianteeman - change - 19 Jul 2017
Milestone Added:
avatar brianteeman brianteeman - change - 19 Jul 2017
Milestone Added:
avatar laoneo
laoneo - comment - 27 Jul 2017

Any feedback here? Honestly I would like to get that into 3.8.

avatar mbabker
mbabker - comment - 28 Jul 2017

I think we can do better than this personally. See #17328 for my proposal.

avatar laoneo
laoneo - comment - 11 Aug 2017

I like the manual registering approach, but I guess extension devs would like to get some autoload routine similar to what we have right now. I guess both can work together.

avatar mbabker
mbabker - comment - 11 Aug 2017

Honestly, we need to stop going with a "register X class name and Y class namespace to find classes/files in" approach system wide. Sooner or later it will cause there to be conflicts if two extensions are trying to use the same short class name which exists in two different namespaces. If someone loaded the paths for the JHtml helpers in the com_users frontend and backend, depending on what order the paths were loaded in (same will apply to namespaces), they may or may not get the correct JHtmlUsers class. The only way you can guarantee that you are using the correct class with the current setup is to be able to use the fully qualified class name when calling JHtml::_() or to have a globally unique shortcut alias which points to a single class.

Explicitly loading helpers into a registry eliminates this conflict. The only requirement that my registry has is that your class has to be loaded before adding it to the registry. With our shift to autoloading extension classes, this is a non-issue.

avatar laoneo
laoneo - comment - 21 Aug 2017

Closing in favor of #17328.

avatar laoneo laoneo - change - 21 Aug 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-08-21 14:47:09
Closed_By laoneo
avatar laoneo laoneo - close - 21 Aug 2017

Add a Comment

Login with GitHub to post a comment