User tests: Successful: Unsuccessful:
Pull Request for Issue #12828.
This solves warnings in addScript[Version]/addStyleSheet[Version] methods when using pre-3.7.0 method signatures with just two parameters.
// JDocument B/C tests
/* addStyleSheet($url, $type = 'text/css', $media = null, $attribs = array()) */
$this->addStyleSheet('/path/to/external/bcaddStyleSheet0.css');
$this->addStyleSheet('/path/to/external/bcaddStyleSheet1.css', 'text/css');
$this->addStyleSheet('/path/to/external/bcaddStyleSheet2.css', '', null, array());
$this->addStyleSheet('/path/to/external/bcaddStyleSheet3.css', 'text/css', 'all', array('scriptid' => 1));
/* addStyleSheetVersion($url, $version = null, $type = 'text/css', $media = null, $attribs = array()) */
$this->addStyleSheetVersion('/path/to/external/bcaddStyleSheetVersion0.css');
$this->addStyleSheetVersion('/path/to/external/bcaddStyleSheetVersion1.css', 'version-string');
$this->addStyleSheetVersion('/path/to/external/bcaddStyleSheetVersion2.css', null, '', null, array());
$this->addStyleSheetVersion('/path/to/external/bcaddStyleSheetVersion3.css', 'version-string', 'text/css', 'all', array('scriptid' => 1));
// JDocument new method signature tests
/* addStyleSheet($url, $options = array(), $attribs = array()) */
$this->addStyleSheet('/path/to/external/addStyleSheet0.css');
$this->addStyleSheet('/path/to/external/addStyleSheet1.css', array(), array('id' => 'stylesheetid'));
$this->addStyleSheet('/path/to/external/addStyleSheet2.css', array(), array('id' => 'stylesheetid', 'data-test' => 1));
$this->addStyleSheet('/path/to/external/addStyleSheet3.css', array(), array('data-attrib' => 'original-value'));
$this->addStyleSheet('/path/to/external/addStyleSheet4.css', array(), array('data-attrib' => 'final-value'));
$this->addStyleSheet('/path/to/external/addStyleSheet5.css', array(), array('data-attrib' => array('item1' => 'value1', 'item2' => 'value2')));
$this->addStyleSheet('/path/to/external/addStyleSheet6.css', array('version' => 'auto'), array('data-attrib' => array('item1' => 'value1', 'item2' => 'value2')));
$this->addStyleSheet('/path/to/external/addStyleSheet7.css', array('version' => 'version-string'), array('media' => 'all', 'data-attrib' => array('item1' => 'value1', 'item2' => 'value2')));
$this->addStyleSheet('/path/to/external/addStyleSheet8.css', array('version' => 'auto', 'conditional' => 'lf IE 9'), array('data-attrib' => array('item1' => 'value1', 'item2' => 'value2')));
// JHTML B/C Tests
/* stylesheet($file, $attribs = array(), $relative = false, $path_only = false, $detect_browser = true, $detect_debug = true) */
JHtml::_('stylesheet', 'media/system/css/jquery.Jcrop.min.css');
JHtml::_('stylesheet', 'system/frontediting.css', array('id' => 'stylesheetid'), true, false, false, false);
// JHtml new method signature tests
/* stylesheet($file, $options = array(), $attribs = array()) */
JHtml::_('stylesheet', 'media/com_finder/css/indexer.css', array(), array('data-attrib' => array('item1' => 3, 'item2' => 'value2')));
JHtml::_('stylesheet', 'plg_fields_gallery/fotorama.min.css', array('relative' => true), array('data-attrib' => array('item1' => 3, 'item2' => 'value2')));
JHtml::_('stylesheet', 'system/calendar-jos.css', array('relative' => true, 'version' => 'auto'), array('data-attrib' => array('item1' => 3, 'item2' => 'value2')));
JHtml::_('stylesheet', 'system/mootree.css', array('relative' => true, 'version' => 'version-string'), array('media' => 'all', 'data-attrib' => array('item1' => 3, 'item2' => 'value2')));
JHtml::_('stylesheet', 'system/mootree_rtl.css', array('relative' => true, 'version' => 'version-string', 'conditional' => 'lf IE 9'), array('media' => 'all', 'data-attrib' => array('item1' => 3, 'item2' => 'value2')));
// JDocument B/C tests
$this->addScript('/path/to/external/bcaddScript0.js');
$this->addScript('/path/to/external/bcaddScript1.js', 'text/javascript');
$this->addScript('/path/to/external/bcaddScript2.js', '', true, false);
$this->addScript('/path/to/external/bcaddScript3.js', 'text/javascript', true, true);
$this->addScriptVersion('/path/to/external/bcaddScriptVersion0.js');
$this->addScriptVersion('/path/to/external/bcaddScriptVersion1.js', 'version-string');
$this->addScriptVersion('/path/to/external/bcaddScriptVersion2.js', null, '', true, false);
$this->addScriptVersion('/path/to/external/bcaddScriptVersion3.js', 'version-string', 'text/javascript', true, true);
// JDocument new method tests
$this->addScript('/path/to/external/addScript0.js');
$this->addScript('/path/to/external/addScript1.js', array(), array('id' => 'scriptid'));
$this->addScript('/path/to/external/addScript2.js', array(), array('id' => 'scriptid', 'data-test' => 1));
$this->addScript('/path/to/external/addScript3.js', array(), array('data-attrib' => 'original-value'));
$this->addScript('/path/to/external/addScript4.js', array(), array('data-attrib' => 'final-value'));
$this->addScript('/path/to/external/addScript5.js', array(), array('data-attrib' => array('item1' => 'value1', 'item2' => 'value2')));
$this->addScript('/path/to/external/addScript6.js', array('version' => 'auto'), array('data-attrib' => array('item1' => 'value1', 'item2' => 'value2')));
$this->addScript('/path/to/external/addScript7.js', array('version' => 'version-string'), array('data-attrib' => array('item1' => 'value1', 'item2' => 'value2')));
$this->addScript('/path/to/external/addScript8.js', array('version' => 'auto', 'conditional' => 'lf IE 9'), array('data-attrib' => array('item1' => 'value1', 'item2' => 'value2')));
// JHTML B/C Tests
JHtml::_('script', 'media/system/js/multiselect.js');
JHtml::_('script', 'media/system/js/calendar.js', false);
JHtml::_('script', 'system/repeatable.js', false, true, false, false, true);
// JHtml new method tests
JHtml::_('script', 'media/com_finder/js/indexer.js', array(), array('data-attrib' => array('item1' => 3, 'item2' => 'value2')));
JHtml::_('script', 'system/progressbar.js', array('relative' => true), array('data-attrib' => array('item1' => 3, 'item2' => 'value2')));
JHtml::_('script', 'system/permissions.js', array('relative' => true, 'version' => 'auto'), array('data-attrib' => array('item1' => 3, 'item2' => 'value2')));
JHtml::_('script', 'system/sendtestmail.js', array('relative' => true, 'version' => 'version-string'), array('async' => 'async', 'defer' => 'defer', 'data-attrib' => array('item1' => 3, 'item2' => 'value2')));
JHtml::_('script', 'system/helpsite.js', array('relative' => true, 'version' => 'version-string', 'conditional' => 'lf IE 9'), array('async' => 'async', 'defer' => 'defer', 'data-attrib' => array('item1' => 3, 'item2' => 'value2')));
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
Question, what about documenting the old way of calling each method,
inside the comment that is above the methods ? Is it needed ?
No, it only adds confusion to the documentation. If you need to reference the old signatures it's easy to find the code.
one more test please... this is a release blocker IMO
Labels |
Added:
?
|
Milestone |
Added: |
Before patch:
Warnings show.
bcaddStyleSheetVersion1.css and bcaddScriptVersion1.js are added without version-string.
After patch:
Warnings are gone.
bcaddStyleSheetVersion1.css and bcaddScriptVersion1.js are added including version-string.
Tested successfully but cannot submit through issue tracker. Getting "Missing commit SHA" error.
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-11-15 21:45:30 |
Closed_By | ⇒ | rdeutz |
I have tested this item✅ successfully on 4921edf
Now the <=J3.6.x way of calling the methods, works, and so does new way (pre-J3.7) too
Question, what about documenting the old way of calling each method,
inside the comment that is above the methods ? Is it needed ?
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12836.