? ? Pending

User tests: Successful: Unsuccessful:

avatar clayfreeman
clayfreeman
2 Aug 2018

Summary of Changes

JToolbarHelper is now Joomla\CMS\Toolbar\ToolbarHelper. This change is necessary to further the adoption of namespaced naming schemes as opposed to the alternative old style.

Testing Instructions

  1. Check for any change in behavior of code that is presently using the JSubMenuHelper class name.
  2. Check for any change in behavior of code that is presently using the JToolbarHelper class name.
  3. Change an instance of JToolbarHelper to Joomla\CMS\Toolbar\ToolbarHelper in some arbitrary code and check for any change in behavior.

Expected result

No change in behavior should occur as a result of the outlined testing methodology. The use of JToolbarHelper should continue to work like normal since it has been aliased to the namespaced edition of the class. The functionality of the namespaced edition of the class should be identical to that of the old version.

Since JToolbarHelper registered JSubMenuHelper with JLoader, administrator/index.php now requires subtoolbar.php so that the class can be made available. This was the preferred method of action as opposed to converting it to a namespaced variant since the class is deprecated.

Documentation Changes Required

Yes. Any recommendation of JToolbarHelper should be changed in favor of using Joomla\CMS\Toolbar\ToolbarHelper.

avatar clayfreeman clayfreeman - open - 2 Aug 2018
avatar clayfreeman clayfreeman - change - 2 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Aug 2018
Category Administration Libraries
avatar clayfreeman clayfreeman - change - 2 Aug 2018
Title
convert `JToolbarHelper` to a namespaced class name
[3.9] convert `JToolbarHelper` to a namespaced class name
avatar clayfreeman clayfreeman - edited - 2 Aug 2018
avatar clayfreeman clayfreeman - change - 2 Aug 2018
The description was changed
avatar clayfreeman clayfreeman - edited - 2 Aug 2018
avatar clayfreeman clayfreeman - change - 2 Aug 2018
Labels Added: ?
avatar mbabker
mbabker - comment - 3 Aug 2018

We've moved this class in 4.0 to the libraries, TBH I don't remember anymore if there's a reason we can't or shouldn't do this for 3.x. // @wilsonge @laoneo

avatar mbabker
mbabker - comment - 3 Aug 2018

(Also if we do this for 3.9 it should be placed in the Joomla\CMS\Toolbar namespace as it is in 4.0 so we don't have several instances of the class being renamed between releases)

avatar clayfreeman
clayfreeman - comment - 3 Aug 2018

@mbabker I dug a little deeper and see that now; I'll revise the location and update my PR comment.

Some sort of compatibility layer should be available before 4.0 hits so that developers have time to switch to the new namespaced variant of the class name.

avatar clayfreeman clayfreeman - change - 3 Aug 2018
The description was changed
avatar clayfreeman clayfreeman - edited - 3 Aug 2018
avatar mbabker
mbabker - comment - 3 Aug 2018

Some sort of compatibility layer should be available before 4.0 hits so that developers have time to switch to the new namespaced variant of the class name.

4.0 is still supporting all the global class names except those explicitly deprecated for removal in 4.0 (basically some of the early migrated Framework packages or classes that are explicitly deprecated and will be removed). So, there is no need to migrate calls to JToolbarHelper to the namespaced variant for a while.

avatar clayfreeman
clayfreeman - comment - 3 Aug 2018

While this is true, Joomla 4.0 is a bit far off. If it were being released tomorrow, this would be a non-issue. But, since it isn't, JToolbarHelper is one of the few classes that you can't find a namespaced variant for when writing an extension.

For developers that are trying to use the new naming scheme exclusively, JToolbarHelper is a bit of a blemish on that record.

avatar mbabker
mbabker - comment - 3 Aug 2018

Oh, I agree it should be done. Just pointing out that there is no rush in completely moving over to all namespaced classes, and that even in 4.0 the old class names will work for the most part. Using namespaced classes keeps your IDE from groaning about missing classes (without generating a stubs file), that's probably the biggest benefit right now.

avatar travisrisner
travisrisner - comment - 3 Aug 2018

I have tested this item successfully on 5b7d763.

avatar jeremyvii
jeremyvii - comment - 8 Aug 2018

This item has been tested successfully on 5b7d763

avatar Quy Quy - change - 8 Aug 2018
Status Pending Ready to Commit
avatar Quy
Quy - comment - 8 Aug 2018

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21372.

avatar mbabker mbabker - change - 9 Aug 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-08-09 12:48:34
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 9 Aug 2018
avatar mbabker mbabker - merge - 9 Aug 2018
avatar NickSdot
NickSdot - comment - 22 Nov 2018

This change is causing issues in 3pd extensions we use.

Warning: require_once(/www/administrator/includes/toolbar.php): failed to open stream: No such file or directory in www/components/com_payplans/xiframework/base/abstract/helper/toolbar.php on line 11

Fatal error: require_once(): Failed opening required 'www/administrator/includes/toolbar.php' (include_path='.:/usr/local/lib/php') in www/components/com_payplans/xiframework/base/abstract/helper/toolbar.php on line 11

Is there any plan to consider this as a B/C breaking change and revert?

avatar clayfreeman
clayfreeman - comment - 22 Nov 2018

Get in touch with the third party developer to have them fix it. It should be as simple as surrounding the require in a conditional.

Alternatively, take the line out of the file yourself.

On Nov 21, 2018, at 10:01 PM, NickSdot notifications@github.com wrote:

This change is causing issues in 3pd extensions we use.

`Warning: require_once(/www/administrator/includes/toolbar.php): failed to open stream: No such file or directory in www/components/com_payplans/xiframework/base/abstract/helper/toolbar.php on line 11

Fatal error: require_once(): Failed opening required 'www/administrator/includes/toolbar.php' (include_path='.:/usr/local/lib/php') in www/components/com_payplans/xiframework/base/abstract/helper/toolbar.php on line 11`

Is there any plan to consider this as a B/C breaking change and revert?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

avatar joomdonation
joomdonation - comment - 22 Nov 2018

It should be as simple as surrounding the require in a conditional.

We just use the below command, works with both Joomla older version and latest version

JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR . '/includes/toolbar.php');
avatar clayfreeman
clayfreeman - comment - 22 Nov 2018

That’s quite a bit more elegant than my suggestion!

On Nov 21, 2018, at 11:11 PM, Tuan Pham Ngoc notifications@github.com wrote:

It should be as simple as surrounding the require in a conditional.

We just use the below command, works with both Joomla older version and latest version

JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR . '/includes/toolbar.php');

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Add a Comment

Login with GitHub to post a comment