Search code examples
migrationjoomla2.5server-errorjoomla3.4

Migration from Joomla 2.5 to Joomla 3.4.5 results in strange server error 500


I installed a brand new, clean Joomla 3.4.5 and then installed a component written by myself, which worked totally fine in Joomla 2.5. In Joomla 3 however, I get server error 500... in some cases...

I narrowed the error down to the following weird situation:

The component is called com_confighdv (I'm extending Joomla core's com_config). I added a view called JustaName, existing of two files:

admin/views/justaname/view.html.php:

<?php
class ConfigHdVViewJustaName extends JViewLegacy
{
}
?>

admin/views/justaname/tmpl/default.php:

Hello world!

This works fine when I go to index.php?option=com_confighdv&view=justaname.

Then I change the view's name from JustaName to Component:

  • The view's folder becomes: admin/views/component/
  • Class declaration becomes: class ConfigHdVViewComponent extends JViewLegacy {}

Now, when I go to index.php?option=com_confighdv&view=component I get a server error 500 :s

I really don't know what to do with this. Help is very much appreciated!


Solution

  • Solved! Switching to Joomla's maximum error reporting provided the explanation:

    Fatal error: Class ConfigHdVModelComponent contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (JModelForm::getForm) in /xxx/administrator/components/com_confighdv/models/component.php on line 18

    So, the problem is not in the view, but in the model that belongs to the Component view!

    I accidentally created this problem myself, by reducing the model declaration to what I thought was the absolute minimum:

    class ConfigHdVModelComponent extends JModelAdmin
    {
    {
    

    While this is not allowed, because you always have to define the getForm method, so:

    class ConfigHdVModelComponent extends JModelAdmin
    {
        public function getForm($data = array(), $loadData = true)
        {
        }
    {