1

I'm running Magento 1.9.3.3 and whenever I try to delete a product I get an HTTP ERROR 500 page. Everything else seems to work normally.

The error log says:

PHP Fatal error: Call to a member function joinRel() on boolean in /home/xxxxxxxx/public_html/app/code/core/Mage/Tag/Model/Tag.php on line 127

This is the relevant section from that tag.php file:

    protected function _getProductEventTagsCollection(Varien_Event_Observer $observer)
{
    return $this->getResourceCollection()
                    ->joinRel()
                    ->addProductFilter($observer->getEvent()->getProduct()->getId())
                    ->addTagGroup()
                    ->load();
}

I can't find any reference to this online at all and I'm completely stumped. Has anyone got any ideas, or suggest a fix?

Many thanks.

  • I'm not familiar with this error. Apparently $this->getResourceCollection() returns false. Just to be sure, did you try to clean the cache and reindex? – Niels Jul 20 '17 at 9:05
  • Yes, have cleared cache numerous times and re-indexed. No difference. – Alan C Jul 20 '17 at 11:58
  • OK, very strange indeed. Did you recently activate or install any new modules that might have changed the behavior? – Niels Jul 20 '17 at 12:20
  • I had recently installed a social media button extension and changed the DNS to run through Cloudflare. I have now uninstalled that extension and changed the DNS back the way it was and no difference. Is it possible that an extension could make a permanent change? I may have to try loading backups onto a test site to see when this probem started. – Alan C Jul 20 '17 at 22:07
  • I have loaded a backup onto a test site from July 2 (pre the social media button extension) and it does delete products correctly. So it seems that the extension has created a persistant issue somehow. Thanks for your time. I will have to roll back. – Alan C Jul 21 '17 at 0:42
0

Apparently $this->getResourceCollection() returns false.

If you look at the code in app/code/core/Mage/Core/Model/Abstract.php, you can see that it tries to load a resource collection for a specified _resourceCollectionName:

public function getResourceCollection()
    {
        if (empty($this->_resourceCollectionName)) {
            Mage::throwException(Mage::helper('core')->__('Model collection resource name is not defined.'));
        }
        return Mage::getResourceModel($this->_resourceCollectionName, $this->_getResource());
    }

Did you see anything in the error logs? Is the Exception thrown for example (/var/log/exception.log by default)? Look like Magento tries to load a resource Collection model that is somehow not defined.

  • The only thing in the exception.log file is a lot of repeated errors for invalid block type. - 'Mage_Core_Exception' with message 'Invalid block type: ' in /home/xxxxxxxx/public_html/app/Mage.php:595. Pretty sure that this is a separate problem that I'm also going to have to sort out. – Alan C Jul 20 '17 at 22:19
  • 1
    Problem solved - it was an extension that was causing the issue. – Alan C Jul 21 '17 at 0:47

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.