I have had the same problem. Fixed it by checking the length of the element which needs to be toggled. The best thing you could do is rewrite this javascript file in your custom Magento theme that you use and add this code.
match: function () {
if(this.toggleElements.length > 0){
this.toggleElements.toggleSingle();
}
},
unmatch: function () {
if(this.toggleElements.length > 0){
this.toggleElements.toggleSingle({destruct: true});
}
}
The error means that an element (object) was being added to a form (object), but the form requires uniquely identified elements. In Magento, you typically create a new instance of a form, then a fieldset, and append fields to the fieldset. Here's an example of how it might look in code:
$model = Mage::registry('cms_block');
$form = new Varien_Data_Form(
array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post')
);
$form->setHtmlIdPrefix('block_');
$fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('cms')->__('General Information'), 'class' => 'fieldset-wide'));
if ($model->getBlockId()) {
$fieldset->addField('block_id', 'hidden', array(
'name' => 'block_id',
));
}
...
The above is taken from Mage_Adminhtml_Block_Cms_Block_Edit_Form::_prepareForm
, and you will likely see the same methodology used for all core admin form setups.
The problem is that somewhere another form field with the ID of path
is being added to a fieldset when one already exists.
So you can try to search your codebase for something like this:
grep -rn "addField('path" /app/code/[local|community]
And see if there are easy-to-spot duplicates. A quick scan myself over the core code pool yields:
./app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php:63:// $fieldset->addField('path', 'select', array(
./app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php:77: $fieldset->addField('path', 'hidden', array(
./app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php:86: $fieldset->addField('path', 'hidden', array(
./app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php:89: $fieldset->addField('path', 'hidden', array(
./app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php:95: $fieldset->addField('path', 'hidden', array(
./app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php:106: $fieldset->addField('path', 'hidden', array(
And so it's possible that your issue lies with some third-party extension that tries to modify or extend a part of the category management forms.
As I said the fields will typically be registered as part of this _prepareForm
method, but it's also possible that within one of these classes there is an event dispatched. For example, see the end of the Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Content::_prepareForm
method. This exposes the form to other modules (maybe a third-party extension) that might be causing your issue.
Best Answer
You are loading two different jQuery resources:
skin/frontend/sm-igame/default/sm/megamenu/js/jquery-1.7.2.min.js
skin/frontend/sm-igame/default/js/jquery.1.11.js
Which never is a good practice.Try to deactivate MegaMenu's jQuery loading somewhere in its preferences / configuration.
Also you might want to run jQuery.noConflict since there might be some other frameworks (such as MooTools etc.) that are occupying the
$
-shorthand for jQuery. When visiting you website I figured that other jQuery calls are throwing "... is not a function" error.You could also try to open the fancybox-overlay with a
jQuery('a > img').fancybox();
instead of$('a > img').fancybox();
($ = shorthand for 'jQuery').Nevertheless a code sample or a link to a page where you use fancybox would be helpul.
After I dug a little deeper into your code: I am not sure why you are using such a large, complex JS-function to manipulate the fancybox-relevant links, image urls, and stuff (
function _SmQuickView()
). This makes it pretty hard to debug since fancybox actually is just a one-liner. Also thebeforeShow
andafterShow
dependencies could probably be handled easier - if they would have to at all, but I'm not sure what you're up to with this.I tried to scale browser down to mobile size and made the
.yt-product-detail . popup-btn
visible. And then fancybox using the icon link just works fine.