A new client called us yesterday and told us that he was seeing some blank pages on his Joomla website. Of course, we have discussed the blank page issue many times on this blog before, but, if you haven’t read any of our previous posts on blank pages, then, in short, here’s what causes them: A PHP fatal error.
So, we maximized error reporting (we changed the value of error reporting to maximum in the configuration.php located under the root directory of the website) and we checked the blank page again, and we saw the following error:
Fatal error: Declaration of DtrTable::load() must be compatible with that of JTableInterface::load() in /var/www/vhosts/[website-address]/httpdocs/administrator/components/com_dtregister/lib/dttable.php on line 214
Aha! A component that used to work no longer works because a very important interface no longer implements its methods the same way. That interface was the JTableInterface.
How did we fix the problem?
We fixed the problem by opening the dttable.php file located under the administrator/components/com_dtregister/lib and changing this function declaration:
function load($id, $reset = true)
to this one:
function load($id = null, $reset = true)
Now, the question is, how did we know that we had to make this particular change in the code to fix the problem? Well, since the DtrTable class extends the JTable class which implements the JTableInterface interface, all we needed to do was to look at the implementation of the load function in the JTableInterface interface in the interface.php file located under the libraries/joomla/table folder. That function was declared the following way:
public function load($keys = null, $reset = true);
Of course, once we fixed the problem, we had a very similar problem in another function in the same class and in other classes as well, and so we fixed them all (it was a very tedious job because it was all manual work). After something like 10 changes, the blank page was gone and the website was running smoothly again.
In our opinion, an even better solution to this problem was to update the problematic extension altogether, but we weren’t sure that the update will make things better or worse, and we didn’t have enough time to try. Additionally, we wanted our readers (that’s you!) to be able to fix the problem easily if it’s in a no-longer-supported-extension.
So, if you have the same problem on your website, then please try to update the affected extension first. If that doesn’t solve the problem, then the best thing that you can do is to manually implement the fix above. If that’s a bit above your head, then why not contact us? Our fees are affordable, our work is fast and professional, and you will gain some new friends who will genuinely care about your business!