?
avatar coolman01
coolman01
21 Feb 2014

Hi - found this error occuring in many sites: "Call to undefined method JDocumentFeed::isHtml5() in /home/mysite/public_html/libraries/joomla/document/html/renderer/head.php on line 73"
Did a search on Google using : "Fatal Error""Call to undefined method JDocumentFeed::isHtml5()"
and found dozens of sites. I also noticed it coming up in the Joomla forum at http://forum.joomla.org/viewtopic.php?f=706&t=835053

avatar coolman01 coolman01 - open - 21 Feb 2014
avatar Bakual
Bakual - comment - 21 Feb 2014

Sounds more like a faulty component or plugin. I'll answer on the forum to narrow this down.

avatar mbabker
mbabker - comment - 21 Feb 2014

When messages like this come up dealing with JDocument classes and undefined methods, my first thought is there is a plugin that is not checking the environment before calling methods. isHtml5() is only part of JDocumentHTML. Plugins (and code in general that is executed in non-format specific classes, most of the system) should do checks like this one before they start manipulating the system.

avatar wilsonge
wilsonge - comment - 23 Feb 2014

I've found this coming out of gantry in the past. would you be using that for your template framework by any chance?

avatar coolman01
coolman01 - comment - 23 Feb 2014

Yes, I am. Do you know what generates it? I'll happily pass it on to Rockettheme.

avatar wilsonge
wilsonge - comment - 23 Feb 2014

No - it's just my personal site so I haven't really bothered to investigate - I'll do some research. Make sure your up to date though - because I don't remember seeing it in the last month or two. I'll do some research though

avatar coolman01
coolman01 - comment - 23 Feb 2014

Everything is up to date. Thanks for researching.

avatar wilsonge
wilsonge - comment - 23 Feb 2014

Hmm well I can't find anything instances except in the Joomla core libraries anywhere on my site - so it must have vanished in an update at some point. See if you can search for any non-core instances of it somewhere

avatar coolman01
coolman01 - comment - 23 Feb 2014

Sorry, I have no idea how to do that - I'm not a programmer or developer

avatar wilsonge
wilsonge - comment - 23 Feb 2014

OK change of plan do you have K2 installed by any chance?

avatar coolman01
coolman01 - comment - 23 Feb 2014

No - Seblod

avatar Fedik
Fedik - comment - 23 Feb 2014

in what case you got this error?
what you tried to achieve?
what page/link you tried open?
which content on this page?

if you use Seblod, then whether error still present if you do same without Seblod installed?

avatar wilsonge
wilsonge - comment - 23 Feb 2014

OK so I think the issue is if you try and create a feed where one doesn't exist. For example on K2 if i append &format=feed&type=rss to a single article item (note view.feed.php doesn't exist for the item view in k2) then I get that error

Does joomla default back to view.html.php if the view.feed.php doesn't exist? If so perhaps we need to add those checks Michael suggested into the JDocumentFeed

avatar Bakual
Bakual - comment - 23 Feb 2014

Does joomla default back to view.html.php if the view.feed.php doesn't exist?

It should not, it should show an 500 error page that the view wasn't found.

avatar Bakual
Bakual - comment - 23 Feb 2014

I'd test by disabling all non-core plugins, especially system and content ones and see if the error goes away. And then enable one after eachother again and see when the error starts again.

avatar coolman01
coolman01 - comment - 23 Feb 2014

OK - I'll have to wait, as this is a live site and I can't turn stuff off
any old time.

On 23 February 2014 20:16, Thomas Hunziker notifications@github.com wrote:

I'd test by disabling all non-core plugins, especially system and content
ones and see if the error goes away. And then enable one after eachother
again and see when the error starts again.


Reply to this email directly or view it on GitHub#3155 (comment)
.

avatar wilsonge
wilsonge - comment - 23 Feb 2014

I've just disabled ALL plugins on my site (except the Joomla user and authentication and user plugin) and still get the error.

BUT if i swap my template back from Gantry to default joomla then the error goes away. So I'm going back to it being a gantry problem. Although I have bugger all clue why as gantry doesn't directly call the function

avatar wilsonge
wilsonge - comment - 23 Feb 2014

OK based on it being a gantry problem - see my previous edit (swap back to a default joomla/non-gantry template and you get the expected 500 error) I'd go to rockettheme and try and figure out the problem there. I'm happy to explain further to them if needed :)

avatar mbabker
mbabker - comment - 23 Feb 2014

Does joomla default back to view.html.php if the view.feed.php doesn't exist? If so perhaps we need to add those checks Michael suggested into the JDocumentFeed

I would not start adding methods dealing with the HTML document to our other document classes. Any place calling JFactory::getDocument() and immediately starting to do things like $doc->isHtml5() is wrong (on the same note, the fact that addStyleDeclaration() is part of the parent JDocument class when it too is HTML specific is wrong). If you're in a part of the system where your code is executed regardless of document type, you need to check the type, period.

avatar wilsonge
wilsonge - comment - 24 Feb 2014

OK so there is NO explicit $doc->isHtml5() calls being made. It's being called in the JRendererHead only in my install. Which is why I'm so damn confused as to how this is being called. I guess it must be deep in the gantry library

avatar Bakual
Bakual - comment - 24 Feb 2014

I'm going to close this issue since it's obviously not an error in core but wrong usage somewhere in Gantry.

avatar Bakual Bakual - change - 24 Feb 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-02-24 12:43:32
avatar Bakual Bakual - close - 24 Feb 2014
avatar Bakual Bakual - close - 24 Feb 2014
avatar zero-24 zero-24 - close - 24 Feb 2014
avatar wilsonge
wilsonge - comment - 24 Feb 2014

Maybe. I dunno whether we can add some additional checks in JDocument though to try and stop these kinds of fatal errors

avatar Bakual
Bakual - comment - 24 Feb 2014

How would you check if some code will call a non-existant method?
The problem is that for some reason, Gantry manages to execute libraries/joomla/document/html/renderer/head.php in the context of JDocumentFeed. Which is strange because JDocumentFeed sure doesn't load a head renderer by itself (Feeds don't have headers) and the file is also not located in the "feed" folder.

avatar ggppdk
ggppdk - comment - 19 Apr 2015

Hello

this is not a Joomla bug,

the problem is that some extensions will ask the error page to be created while format is not HTML, by throwing an exception, i am not sure if this appropriate behaviour, but the error.php of some templates is not checking the current format, to see how your template is (or not) handling this case, just test this:

  1. get any invalid URL of your website
  2. add to it to ?format=raw or (&format=raw) ... or ?format=json or ?format=xml
    see if you get fatal error

to fix this, and at the same time you have 2 options either exit and output nothing or print some short message like (add at the top of your template's error.php):

(--ADD the code after the check if $this->error isset)

$_format = JFactory::getApplication()->input->get('format', 'html');
if ($_format!='html') {  // catch ALL non html formats, or maybe output special e.g. if xml output XML ??
    die(
        'Exception with ERROR code:'.$this->error->getCode()
        .' Thrown by --"'.$_format.'"-- format URL: '. JURI::current()
        .' Error: '.$this->error->getMessage()
    );
}
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?
avatar kat05
kat05 - comment - 7 Dec 2015

Does anyone know why
https://www.joomla.org/announcements/release-news/5640-timeline-update-for-3-5.htmll
(notice the extra l at the end of the url) throws a blank page and not the proper Joomla 404 error page?

avatar ggppdk
ggppdk - comment - 7 Dec 2015

Obviously a PHP fatal error occured, if someone enables error reporting (or if he/she checks server's error log) , then the fatal error will be visible

A related issue to this discussion is this: #7459

but i don't think the reason for blank page is #7459
these seem to be 2 different issues

avatar kat05
kat05 - comment - 7 Dec 2015

I assume that joomla.org is running on the latest version of Joomla, so it seems safe to say that there is an issue in the Joomla core with error handling and display of 404 pages.

avatar Bakual
Bakual - comment - 7 Dec 2015

Probably "Document type not found" or something like that. SEF Suffixes are a bit special because they don't relate to a page but toi a document type. Since there is no file for that, it will fail loading the respective view file (view.htmll.php in this case) .

avatar mbabker
mbabker - comment - 7 Dec 2015

Same suffix produces a normal Joomla error page on the developer site, so my initial hunch is there's something with the server configuration for Rochen's MCS setup versus their MVS offerings.

avatar kat05
kat05 - comment - 9 Dec 2015

Sorry to bug you, but are there any news on this? We're trying to debug an issue in Gantry 4, but as long as there are issues not related to Gantry (like on joomla.org) , it would be helpful to have those figured out first.

avatar Bakual
Bakual - comment - 9 Dec 2015

No news because it's very likely a server issue. It's not related to core and this issue is closed.

avatar mbabker
mbabker - comment - 9 Dec 2015

Well, I just tested on the staging site for .org and got this message back:

Fatal error: Call to undefined method JDocumentRaw::addHeadLink() in modules/mod_search/mod_search.php on line 23

So once again some of the bad architecture in JDocument is screwing things up. It's not an issue with Joomla's error handling, it's just how bad JDocument sucks.

avatar Bakual
Bakual - comment - 9 Dec 2015

I'm actually a bit surprised the module is even loaded when JDocumentRaw is active. Is that module active in the error page?
In my installations, I either get a 404 from Apache or Joomla. I don't get that fatal error.

avatar brianteeman
brianteeman - comment - 9 Dec 2015

https://github.com/joomla/joomla-cms/blob/staging/templates/protostar/error.php#L127

On 9 December 2015 at 19:30, Thomas Hunziker notifications@github.com
wrote:

I'm actually a bit surprised the module is even loaded when JDocumentRaw
is active. Is that module active in the error page?
In my installations, I either get a 404 from Apache or Joomla. I don't get
that fatal error.


Reply to this email directly or view it on GitHub
#3155 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar mbabker
mbabker - comment - 9 Dec 2015

The joomla.org template renders the position-0 (search bar) and position-1 (main menu) module positions on the error page so it can be navigated from. On the dev site Smart Search is the search component in use and on the main .org site the "legacy" Search component is used.

avatar Bakual
Bakual - comment - 9 Dec 2015

Personally I think the error page should be checking the document type first before trying to load modules. Would that work?

avatar wilsonge
wilsonge - comment - 9 Dec 2015

@Bakual In JDocument::getInstance if it can't find the relevant type (which obviously it can't in this case as it is malformed in .htmll and JDocumentHtmll doesn't exist so it falls back to JDocumentRaw

avatar mbabker
mbabker - comment - 9 Dec 2015

Nope. There's a JDocumentError object that the error page is based on which is different than the JDocumentHTML object that's normally used for HTML requests.

avatar Bakual
Bakual - comment - 9 Dec 2015

Ah. So then the module needs to check itself if it's in HTML mode.

On my servers, a htmll suffixes doesn't even get into Joomla. It's shot down by Apache. May be related to different .htaccess files or server setups. That's why I'm asking stupid questions as I can't really reproduce it :smile:

avatar jeffgoh
jeffgoh - comment - 5 May 2016

Appears to be a gantry issue. Here is a current backtrace I pulled off a recently port-in of a
Joomla 3.5 instance. Drives our log monitoring crazy because, well, "Fatal" is a bad word.

May 5 10:34:12 server httpd: PHP Fatal error: Call to undefined method JDocume
ntRaw::isHtml5() in /web/website/libraries/joomla/document/renderer/html/head.ph
p on line 67
May 5 10:34:12 server httpd: PHP Stack trace:
May 5 10:34:12 server httpd: PHP 1. PlgSystemRedirect::handleException($excep
tion = class Exception { protected $message = 'View not found [name, type, prefi
x]: article, ico, contentView'; private $string = ''; protected $code = 404; pro
tected $file = '/web/website/libraries/legacy/controller/legacy.php'; protected
$line = 885; private $trace = array (0 => array (...), 1 => array (...), 2 => ar
ray (...), 3 => array (...), 4 => array (...), 5 => array (...), 6 => array (...
), 7 => array (...), 8 => array (...), 9 => array (...)); private $previous = NU
LL; public $xdebug_message = ' ="5"> ;\'>( ! ) Exception: View not found [name, type, prefix]: article, ico, c
ontentView in /web/website/libraries/legacy/controller/legacy.php on line 885
\nCall St
ack\n# ft\' bgcolor=\'#eeeeec\'>TimeMemory<
/th>Function or=\'#eeeeec\'>Location\n
10.0004 ' align=\'right\'>240560{main}( ) /web/website/index.php\' bgcolor=\'#eeeeec\'>.../index.php:0\n<
tr>2 \'center\'>0.0...' }) /web/website/plugins/system/redirect/redirect.php:0
May 5 10:34:12 server httpd: PHP 2. PlgSystemRedirect::doErrorHandling($error
= class Exception { protected $message = 'View not found [name, type, prefix]:
article, ico, contentView'; private $string = ''; protected $code = 404; protect
ed $file = '/web/website/libraries/legacy/controller/legacy.php'; protected $lin
e = 885; private $trace = array (0 => array (...), 1 => array (...), 2 => array
(...), 3 => array (...), 4 => array (...), 5 => array (...), 6 => array (...), 7
=> array (...), 8 => array (...), 9 => array (...)); private $previous = NULL;
public $xdebug_message = '<th align=\'left\' bgcolor=\'#f57900\' colspan="5"


( ! ) Exception: View not found [name, type, prefix]: article, ico, conte
ntView in /web/website/libraries/legacy/controller/legacy.php on line 885
\nCall Stack<
/th>\n# bgcolor=\'#eeeeec\'>TimeMemory
Function '#eeeeec\'>Location\n1 d>0.0004 ign=\'right\'>240560{main}( ) /website/index.php\' bgcolor=\'#eeeeec\'>.../index.php:0\n<
td bgcolor=\'#eeeeec\' align=\'center\'>2 nter\'>0.0...' }) /web/website/plugins/system/redirect/redirect.php:80
May 5 10:34:12 server httpd: PHP 3. JErrorPage::render($error = class Excepti
on { protected $message = 'View not found [name, type, prefix]: article, ico, co
ntentView'; private $string = ''; protected $code = 404; protected $file = '/web
/website/libraries/legacy/controller/legacy.php'; protected $line = 885; private
$trace = array (0 => array (...), 1 => array (...), 2 => array (...), 3 => arra
y (...), 4 => array (...), 5 => array (...), 6 => array (...), 7 => array (...),
8 => array (...), 9 => array (...)); private $previous = NULL; public $xdebug_m
essage = ' ackground-color: #cc0000; color: #fce94f; font-size: x-large;\'>( ! ) Exc
eption: View not found [name, type, prefix]: article, ico, contentView in /web/w
ebsite/libraries/legacy/controller/legacy.php on line 885\n
Call Stack\n<
th align=\'center\' bgcolor=\'#eeeeec\'># ec\'>TimeMemory \' bgcolor=\'#eeeeec\'>FunctionLocat
ion\n1 #eeeeec\' align=\'center\'>0.000424
0560{main}( ) hp\' bgcolor=\'#eeeeec\'>.../index.php:0\n eeec\' align=\'center\'>20.0...' }
) /web/website/plugins/system/redirect/redirect.php:223
May 5 10:34:12 server httpd: PHP 4. JDocumentError->render($cache = FALSE, $p
arams = array ('template' => 'gantry', 'directory' => '/web/website/templates',
'debug' => '0')) /web/website/libraries/cms/error/page.php:67
May 5 10:34:12 server httpd: PHP 5. JDocumentError->_loadTemplate($directory
= '/web/website/templates/gantry', $filename = 'error.php') /web/website/librari
es/joomla/document/error.php:113
May 5 10:34:12 server httpd: PHP 6. require_once() /web/website/libraries/joo
mla/document/error.php:142
May 5 10:34:12 server httpd: PHP 7. JDocumentRendererHtmlHead->render($head =
NULL, $params = uninitialized, $content = uninitialized) /web/website/templ
ates/gantry/error.php:87
May 5 10:34:12 server httpd: PHP 8. JDocumentRendererHtmlHead->fetchHead($doc
ument = class JDocumentRaw { public $title = '404 - Error: 404'; public $descrip
tion = '...'; public $link = ''; public $base = ''; public $language = 'en-gb';
public $direction = 'ltr'; public $_generator = 'Joomla! - Open Source Content M
anagement'; public $_mdate = ''; public $_tab = ' '; public $_lineEnd = '\n'; p
ublic $_charset = 'utf-8'; public $_mime = 'text/html'; public $_namespace = '';
public $_profile = ''; public $_scripts = array ('/templates/gantry/js/selectiv
izr-min.js' => array (...), '/libraries/gantry/js/browser-engines.js' => array (
...), '/templates/gantry/js/rokmediaqueries.js' => array (...)); public $_script
= array ('text/javascript' => ''); public $_styleSheets = array ('/libraries/ga
ntry/css/grid-responsive.css' => array (...), '/templates/gantry/css-compiled/bo
otstrap.css' => array (...), '/templates/gantry/css-compiled/master-53f95a45aa1d
40970d8d57ed4b5a8aec.css' => array (...), '/templates/gantry/css/master-ie8.css'
=> array (...), '/templates/gantry/css-compiled/mediaqueries.css' => array (...
)); public $_style = array ('text/css' => '#rt-logo {background: url(/images/log
o.png) 50% 0 no-repeat !important;}\n#rt-logo {width: 300px;height: 54px;}\n');
public $_metaTags = array (); public $_engine = NULL; public $_type = 'ico'; pro
tected $mediaVersion = 'f1067a31dc3c12a0e53bfb517d711089' }) /web/website/librar
ies/joomla/document/renderer/html/head.php:34


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

avatar jeffgoh
jeffgoh - comment - 5 May 2016

I got it to "work" in the sense of getting rid of the FATAL error by making these changes.

< if ($document->isHtml5())

  if ($document->getType() == 'html' &&  $document->isHtml5())

135c135,136

< if (!is_null($strAttr['mime']) && (!$document->isHtml5() || $strAttr['mime'] != 'text/css'))

      if (!is_null($strAttr['mime']) && 
      ( $document->gettype() != 'html' || !$document->isHtml5() || $strAttr['mime'] != 'text/css'))

186c187

< if (!is_null($strAttr['mime']) && (!$document->isHtml5() || !in_array($strAttr['mime'], $defaultMimes)))

      if (!is_null($strAttr['mime']) && ($document->gettype() != 'html' || !$document->isHtml5() || !in_array($strAttr['mime'], $defaultMimes)))


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

Add a Comment

Login with GitHub to post a comment