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
Use the JHtml::_ function instead of calling functions directly. #12546
Conversation
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.
Please revert the changes in JHtmlTest
. We want to explicitly only test the actual functions there, not that the loader is able to resolve to the correct function as well (we have tests for that part specifically already).
libraries/cms/html/html.php
Outdated
@@ -670,7 +670,7 @@ public static function stylesheet($file, $attribs = array(), $relative = false, | |||
* | |||
* @return mixed nothing if $path_only is false, null, path or array of path if specific js browser files were detected. | |||
* | |||
* @see JHtml::stylesheet() | |||
* @see JHtml::_('stylesheet', ) |
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.
Can you revert this line too (and if there are any others in doc blocks, those as well)?
126d01d
to
3973dfb
Compare
@mbabker tests have been reverted, please check. |
I have tested this item ✅ successfully on 3973dfb This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12546. |
@okonomiyaki3000 can you update your PR, it's out of sync, Thanks |
3973dfb
to
de758c7
Compare
Should be in sync now. |
I have tested this item ✅ successfully on ae82474 On new installation PHP7.1.1 and Joomla! 3.7.0-beta2 dev [ Amani ] 2-February-2017 18:53 GMT:
|
I have just fixed the conflicts. -> RTC |
Pull Request for Issue # .
Summary of Changes
Instead of calling JHtml static functions directly, call them with the underscore function like
JHtml::_('functionname');
so that it's possible to override them.Testing Instructions
The changed files could potentially affect many pages (for example, any list page with a disabled ordering column). You should see no difference before and after applying the patch.
Documentation Changes Required
No but, if there is some documentation for developers, it would be a good idea for that documentation to make it clear that
JHtml
static functions should not be called directly but invoked through the_
function.