gestadieu / sfAdminThemejRollerPlugin

Symfony admin generator with jQuery UI Theme Roller integration
MIT License
24 stars 9 forks source link

_csrf_token [CSRF attack detected.] on batch actions #14

Closed gomezCarlos closed 13 years ago

gomezCarlos commented 13 years ago

greetings,

I just donwloaded the plugin by symfony plugin:install and I want to know if the issue about the csrf token is solved, because my module fails at batch delete. Does exist a way to fix this?

gomezCarlos commented 13 years ago

I found this by google and seems to work very well:

http://sakrawebstudio.blogspot.com/2010/10/csrftoken-csrf-attack-detected-error.html Solution:

 Edit plugins/sfAdminThemejRollerPlugin/data/generator/sfDoctrineModule/jroller/template/templates/_list_batch_actions.php and change line 9 from:

[?php $form = new sfForm(); if ($form->isCSRFProtected()): ?]

to:

[?php $form = new BaseForm(); if ($form->isCSRFProtected()): ?]
Edit plugins/sfAdminThemejRollerPlugin/data/generator/sfDoctrineModule/jroller/parts/batchAction.php and change line 29 from:

$validator = new sfValidatorDoctrineChoice(array('model' => '<?php echo $this->getModelClass() ?>'));

to:

$validator = new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => '<?php echo $this->getModelClass() ?>'));
Type symfony cc to clear the cache.