RC Release! EasySocial 3.2 RC is available now! Test it out today and share your feedback to us ✨

Helpdesk

Hi

I have just realized that Payplans (latest 4.x) is breaking the RSS feeds on my sites. I did some debugging and quickly found that it's a well known issue that affected multiple extensions over the years.

The problem happens because Payplans calls JFactory:getDocument() before the onAfterRoute event. In doing so, it forces Joomla to have a HTML document type and so the RSS feeds are broken.

Very importantly, this will not happen on all sites. It happens on ours because our RSS feeds have URLs such as /blog/feed/rss/

On site with standard Joomla SEF, feeds have URLs such as: /blog/feed/rss/?format=feed. When there's a "?format=feed" in the URL, the problem does not occur.

Note that the same will happen with any non-html request (ie pdf, json) as long as "?format=xxx" is not in the URL.

The bug is caused in 2 locations:

Your system plugin extends the class PPPlugins. In its constructor, this class does:

$this->info = PP::info();
$this->theme = PP::themes();


PP:info() cause the loading of class PayPlans which has $this->doc = JFactory::getDocument(); in its constructor (line 98 of administrator/components/com_payplans/includes/dependencies.php)

and

PP::themes() also has $this->doc = JFactory::getDocument(); in its constructor (line 39 of administrator/components/com_payplans/includes/themes/themes.php)

Both these calls (JFactory::getDocument()) are not allowed in Joomla before onAfterRoute as they cause the bug we are seeing.

It is not legal to call JFactory::getDocument() in the constructor of a system plugin before onAfterRoute has been triggered.
The reason is that before onAfterRoute, the SEF URL has not been decoded yet and so Joomla does not know which format is the document. It therefore forces it to html. That's ok in general but causes a bug for non-html document such as rss feeds, json or pdf.

I have not yet had time to look for a fix myself but it's actually urgent. It appears our RSS feeds are broken due to this issue since we updated to Payplans 4.

Best regards

This section can only be seen by users with a valid subscription.
If you have a valid subscription, please login now

Your time
Stack Ideas HQ
Support is
Online

The support team is online and will be able to answer your inquiries. Please stay calm, follow the rules and do not cross post.

We will attend to you as soon as we can.