I google and only find it's to do with
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
and I have tried a couple of solutions but still can't get the one which works for me...
Magento Community Edition V1.7.0.2
Any idea/suggestion?
Thanks!
Do you have any custom extension which has a field which affects Admin product page? If so disable it and try again.
first thing first, open product editing page and view source, find if there is
<input name="form_key" type="hidden" value=".....
No, it deosn't have any cases in \app\design\adminhtml\default\default\template\catalog\product directory files.
I mean check the html code in browser in source view.
in template, its added like this
<?php echo $this->getBlockHtml('formkey')?>
we need to first make sure its there in the html, then figure out why its not sent to server or why the value is incorrect.
Yes, in the source code, it does have
<input name="form_key" type="hidden" value="......." />
and I belive it comes from this code:
app/design/adminhtml/default/template/formkey.phtml
<div><input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" /></div>
which seems correct.
in Mage_Core_Controller_Varien_Action::_validateFormKey
var_dump($this->getRequest()->getParam('form_key', null), Mage::getSingleton('core/session')->getFormKey());
if they contain different hash value, then your core/ession is not holding generated form key,
if the first is empty, then your form key is not sent back,
if the first is some non-hash string, then your form key is overided by some other filed.
Yes, indeed. The first value
$this->getRequest()->getParam('form_key')
is NULL.
make sure its in the form element, or there isn't another form_key field with empty value
Do you mean, i should replace all
$this->getRequest()->getParam('form_key')
on the site with
Mage::getSingleton('core/session')->getFormKey()
?