0

I'm getting this error message when I open a product from admin -

Fatal error: Class 'Varien_Data_Form_Element_Videos' not found in /home/firstgea/public_html/lib/Varien/Data/Form/Abstract.php on line 146

History: I used a 1.8 database and a clean install of Magento 1.9.1. So I think it's a video plugin but I don't know how to get rid of it.

  • Go to System > Configuration and select the Advance tab (which his under 'ADVANCE' section.) Then try to disable the relevant extension – Sukeshini May 7 '15 at 0:12
1

I finally solved my problem. What a huge feeling of accomplishment. I used two different answers from various others and was able to get rid of the attribute.

  1. Backed up my system.
  2. Went to database and located “eav_attribute” table.
  3. Looked up Videos and changed the value of is_user_defined to 1
  4. Logged back in to Admin and located the attribute Videos
  5. Delete
  6. More errors and nearly paniced, but was comfortable since I did a back-up.
  7. Found solution for my errors here - https://stackoverflow.com/questions/18480310/magento-exception-printing-is-disabled-by-default-for-security-reasons

And that was it! Everything works fine now!

0

Finn this case, you need to create class for your custom input field Videos at magento library folder location lib/Varien/Data/Form/Element Here you find list of input files relative class.

For case of view,you need to create the

<?php
class Varien_Data_Form_Element_Video extends Varien_Data_Form_Element_Abstract {
    public function __construct($data) {
        parent::__construct($data);
        $this->setType('file');
    }

    public function getElementHtml() {
        $html = '';
        if ($this->getValue()) {
            $url = $this->_getUrl();
            if( !preg_match("/^http\:\/\/|https\:\/\//", $url) ) {
                $url = Mage::getBaseUrl('media') . $url;
            }
            $html = '<a href="'.$url.'" onclick="VideoPreview(\''.$this->getHtmlId().'_video\'); return false;"><img src="'.$url.'" id="'.$this->getHtmlId().'_video" title="'.$this->getValue().'" alt="'.$this->getValue().'" height="22" width="22" /></a> ';
        }
        $this->setClass('input-file');
        $html.= parent::getElementHtml();
        $html.= $this->_getDeleteCheckbox();
        return $html;
    }

    protected function _getDeleteCheckbox() {
        $html = '';
        if ($this->getValue()) {
            $label = Mage::helper('core')->__('Delete video');
            $html .= '<span>';
            $html .= '<input type="checkbox" name="'.parent::getName().'[delete]" value="1" id="'.$this->getHtmlId().'_delete"'.($this->getDisabled() ? ' disabled="disabled"': '').'/>';
            $html .= '<label for="'.$this->getHtmlId().'_delete"'.($this->getDisabled() ? '' : '').'> '.$label.'</label>';
            $html .= $this->_getHiddenInput();
            $html .= '</span>';
        }
        return $html;
    }

    protected function _getHiddenInput() {
        return '<input type="hidden" name="'.parent::getName().'[value]" value="'.$this->getValue().'" accept="video/*" />';
    }

    protected function _getUrl() {
        return $this->getValue();
    }

    public function getName() {
        return  $this->getData('name');
    }
}
  • I ADDED the above code to text, Amit, and I got this error - Parse error: syntax error, unexpected '<' in /home/firstgea/public_html/lib/Varien/Data/Form/Element/Text.php on line 54 – user3612521 May 7 '15 at 12:20
  • Ignore above. I had included <?php and didn't need it. But I am not sure if I was suppose to add it to an element or create a new element. So I tried with text.php and also with Abstract.php and I got the same error message – user3612521 May 7 '15 at 12:37

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.