The condition was that the RSS feeds were broken. Depending on the
browser, you either got an error or you were returned to the original
page. SEF and suffixes were turned on. Joomla had been upgraded to
the latest version.
Debugging involved tracing when the "format" variable was set so that
Joomla knew that the page was a feed. I found the best place to
intercept this was by putting:
echo debug_print_backtrace();
at the start of the JFactory::getDocument() method in
/libraries/joomla/factory.php
This revealed that a few, what I'll call "content" related, plugins
were firing when the "onAfterInitialise" event was triggered by
Joomla's event handling system. So I examined these and found the
root cause was where a plugin called JFactory::getDocument BEFORE the
request URL had been routed because it was triggered by the
"onAfterInitialise" event (routing is done only after this event is
fired). Only during the routing process does the ".feed" in a SEF URL
get transformed into "format=feed". Calling JFactory::getDocument
before this happens mean that JDocument will assume the default case -
that the request is for a regular HTML page. Since the factory method
returns a singleton, all subsequent calls to JFactory::getDocument
return the already initialised (to HTML) document.
The "hot fix" in my case was to simply rename the plugin function for
"onAfterInitialise" to "onAfterRoute". All feeds worked normally
after that.
SUMMARY:
When you are writing system plugins, never make a call to
JFactory::getDocument in any method that triggers before
"onAfterRoute", such as "onAfterInitialise". Doing so will cripple
any document format pages other than HTML (such as feeds, PDF's, et
al) when both SEF and Add Suffix are turned on in Global
Configuration.
Regards,
Andrew Eddie
http://learn.theartofjoomla.com - training videos for Joomla 1.6 developers