?
avatar webnetcoder
webnetcoder
4 Jan 2016

Steps to reproduce the issue

Upgraded to 3.4.8, no errors.
View front end of website and straight away I can tell that my overwrites have not working.
In my template folder I have:

/template
  /html
    /com_content
      /article
        default.php
      /form
        edit.php
    /mod_login
      default_logout.php
    /mod_menu
      default.php
      default_component.php
      default_url.php
      index.html
    /renderer
      head.php

Expected result

Everything should work.
e.g no mootools.js or bootstrap.css should be included in the head as per my code in renderer/head.php

Actual result

mootools.js and all bootstrap files are included in the header.

After 3.4.5 upgrade I had no issues.

System information (as much as possible)

PHP Built On Linux reginald 4.2.0-22-generic #27-Ubuntu SMP Thu Dec 17 22:57:08 UTC 2015 x86_64
Database Version 5.6.27-0ubuntu1
Database Collation latin1_swedish_ci
PHP Version 5.6.11-1ubuntu3.1
Web Server Apache/2.4.12 (Ubuntu)
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 3.4.8 Stable [ Ember ] 24-December-2015 19:30 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36

Additional comments

avatar webnetcoder webnetcoder - open - 4 Jan 2016
avatar mbabker mbabker - close - 4 Jan 2016
avatar mbabker
mbabker - comment - 4 Jan 2016

Joomla core does not have a manner in which to override the JDocumentRenderer classes. If you are doing this, then it is by way of a third party plugin and you should contact the developer of it.

avatar mbabker mbabker - change - 4 Jan 2016
The description was changed
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-01-04 23:13:36
Closed_By mbabker
avatar mbabker mbabker - close - 4 Jan 2016
avatar webnetcoder
webnetcoder - comment - 5 Jan 2016

My overwrite was working in 3.4.5 though I don't understand

avatar mbabker
mbabker - comment - 5 Jan 2016

Again, Joomla core does not provide a manner to override JDocumentRenderer classes in the way you've done so. The only way to accomplish it is through the use of third party plugins. The core method of loading a renderer checks if the class exists (meaning it could be pre-loaded into an autoloader before JDocument::loadRenderer() is called for that renderer type) and if it has not been loaded it manually looks in the libraries/joomla/document directory for the correct renderer type. The manner in which you've made your override requires some sort of plugin which has either overridden the JDocument class itself (i.e. a core hack) or adjusts the autoloader to register your override instead of using the core class.

avatar webnetcoder
webnetcoder - comment - 5 Jan 2016

Okay thank you for this. What would be the best way about making sure mootools.js and all bootstrap css dosent display in the header of my template?

avatar bertmert
bertmert - comment - 5 Jan 2016

Besides not always reliable code in template (search in www!), The ideal solution without surprising side effects:
Extending this demo plugin of mbabker: https://github.com/mbabker/bs3-demo
Plus thinking about: mbabker/bs3-demo#2
(We've found a solution inside plugin meanwhile but this is an issue tracker here, not a forum. So, too much...)

Add a Comment

Login with GitHub to post a comment