0

Fatal error: Call to a member function setUrl() on null in /app/code/local/Ced/CsProduct/Block/Media/Uploader.php on line 37

I'm using the below code

$this->getConfig()->setUrl(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/*/upload'));
8
  • at the end why it's double slash getUrl('//upload')); ? is it on purpose?
    – Mohit Rane
    Commented Jul 25, 2019 at 9:36
  • getUrl('*/*/upload')); code is this..
    – Vipin
    Commented Jul 25, 2019 at 9:37
  • can you explain what you're trying to achieve by this code?
    – Mohit Rane
    Commented Jul 25, 2019 at 9:38
  • Actually case is that i have create the new product choose product type then continue then showing that error..
    – Vipin
    Commented Jul 25, 2019 at 9:43
  • Try this code Mage::helper("adminhtml")->getUrl("*/*/upload"). Commented Jul 25, 2019 at 9:46

1 Answer 1

1

Change;

$this->getConfig()->setUrl(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/*/upload'));

To;

    $this->getUploader()->getUploaderConfig->setUrl(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/*/upload'));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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