1

This isnt a request for a fix as I have done some research and found that I can add the code below and it should resolve the problem:

if(!class_exists('JToolbarHelper')) {
   require_once JPATH_ADMINISTRATOR . '/includes/toolbar.php';
}

This issue is, in which file do I need to put the code? The exact error is:

Fatal error: Class 'JToolbarHelper' not found in /home/waterfro/public_html/new/administrator/components/com_iproperty/helpers/iproperty.php on line 116

Ok updated - my bad, I have 2 joomla installations on the server - Line 116 of the code is the first brace in the following:

class IpToolbar extends JToolbarHelper
{
    public static function approveList($task = 'approve', $alt = 'COM_IPROPERTY_APPROVE')
    {
        $bar = JToolbar::getInstance('toolbar');
        $bar->appendButton('Standard', 'thumbs-up', $alt, $task, true);
    } 

    public static function unapproveList($task = 'unapprove', $alt = 'COM_IPROPERTY_UNAPPROVE')
    {
        $bar = JToolbar::getInstance('toolbar');
        $bar->appendButton('Standard', 'thumbs-down muted', $alt, $task, true);
    }

    public static function featureList($task = 'feature', $alt = 'COM_IPROPERTY_FEATURE')
    {
        $bar = JToolbar::getInstance('toolbar');
        $bar->appendButton('Standard', 'star', $alt, $task, true);
    } 

    public static function unfeatureList($task = 'unfeature', $alt = 'COM_IPROPERTY_UNFEATURE')
    {
        $bar = JToolbar::getInstance('toolbar');
        $bar->appendButton('Standard', 'star-empty', $alt, $task, true);
    }

    public static function superList($task = 'super', $alt = 'COM_IPROPERTY_SUPER')
    {
        $bar = JToolbar::getInstance('toolbar');
        $bar->appendButton('Standard', 'plus', $alt, $task, true);
    } 

    public static function unsuperList($task = 'unsuper', $alt = 'COM_IPROPERTY_UNSUPER')
    {
        $bar = JToolbar::getInstance('toolbar');
        $bar->appendButton('Standard', 'minus', $alt, $task, true);
    }

    public static function clearHits($msg = '', $task = 'clearhits', $alt = 'COM_IPROPERTY_CLEAR_HITS')
    {
        $bar = JToolbar::getInstance('toolbar');

        if ($msg)
        {
            $bar->appendButton('Confirm', $msg, 'refresh', $alt, $task, true);
        }
        else
        {
            $bar->appendButton('Standard', 'refresh', $alt, $task, true);
        }
    }

    public static function saveCatList($task = 'saveCats', $alt = 'JTOOLBAR_APPLY', $check = false)
    {
        $bar = JToolbar::getInstance('toolbar');
        $bar->appendButton('Standard', 'publish', $alt, $task, $check);
    } 

    public static function backupBtn($task = 'backupDB', $alt = 'COM_IPROPERTY_BACKUP', $check = false)
    {
        $bar = JToolbar::getInstance('toolbar');
        $bar->appendButton('Standard', 'new', $alt, $task, $check);
    }

    public static function restoreBtn($task = 'restoreDB', $alt = 'COM_IPROPERTY_RESTORE', $check = false)
    {
        $bar = JToolbar::getInstance('toolbar');
        $bar->appendButton('Standard', 'new', $alt, $task, $check);
    }

    public static function backBtn($alt = 'JTOOLBAR_BACK', $href = 'javascript:history.back();')
    {
        $bar = JToolbar::getInstance('toolbar');
        $bar->appendButton('Link', 'arrow-left', $alt, $href);
    }

    public static function importBtn($task = 'import', $alt = 'COM_IPROPERTY_IMPORT', $check = false)
    {
        $bar = JToolbar::getInstance('toolbar');
        $bar->appendButton('Standard', 'new', $alt, $task, $check);
    }
}

Can anyone help me try and locate the correct location to add the require? I'll happily provide some more information should it be needed. Thanks D

  • com_iproperty is a 3rd party extension, so assuming you're using the latest version, I'd suggest contacting the developer regarding this bug. – Lodder May 4 '17 at 14:54
  • Hi Lodder, the client's subscription has expired and they do not wish to update it at present. I have contacted IProperty but they are unwilling to help obviously - I was hoping there would be a way to rectify this myself. – Dtorr1981 May 4 '17 at 14:58
  • Fair enough. And are you sure that the code you've provided is from the administrator/components/com_iproperty rather than components/com_iproperty directory? – Lodder May 4 '17 at 15:05
  • Yes, it's definitely from the Admin section - I'll added the full content to the post. – Dtorr1981 May 4 '17 at 15:18
  • Admin pages should have that file loaded by default. – Richard B May 4 '17 at 17:39
1

Note you should be using:

JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR . '/includes/toolbar.php');

going forward.

0

Ok, I just added the code below at the top of the file and the page loads correctly :)

if(!class_exists('JToolbarHelper')) {
   require_once JPATH_ADMINISTRATOR . '/includes/toolbar.php';
}

Thanks for all you support as always. Regards D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.