[-] BO : #PSFV-855 : Fix bug in BlockCMS AND set submit_action to NULL

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14633 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2012-04-13 14:15:45 +00:00
parent 58ef5e6e9b
commit 2b807940ae
4 changed files with 6 additions and 5 deletions
@@ -31,7 +31,7 @@
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
{block name="defaultForm"}
<form id="{$table}_form" class="defaultForm {$name_controller}" action="{$current}&{$submit_action}=1&token={$token}" method="post" enctype="multipart/form-data" {if isset($style)}style="{$style}"{/if}>
<form id="{$table}_form" class="defaultForm {$name_controller}" action="{$current}&{if !empty($submit_action)}{$submit_action}=1{/if}&token={$token}" method="post" enctype="multipart/form-data" {if isset($style)}style="{$style}"{/if}>
{if $form_id}
<input type="hidden" name="{$identifier}" id="{$identifier}" value="{$form_id}" />
{/if}
+2 -2
View File
@@ -46,7 +46,7 @@ class HelperFormCore extends Helper
public $title = null;
/** @var string Used to override default 'submitAdd' parameter in form action attribute */
public $submit_action = '';
public $submit_action;
public $token;
public $languages = null;
@@ -69,7 +69,7 @@ class HelperFormCore extends Helper
public function generate()
{
$this->tpl = $this->createTemplate($this->base_tpl);
if ($this->submit_action == '')
if (is_null($this->submit_action))
$this->submit_action = 'submitAdd'.$this->table;
$this->context->controller->addJS(_PS_JS_DIR_.'form.js');
+1 -1
View File
@@ -214,7 +214,7 @@ class AddressControllerCore extends FrontController
if ($result = $address->save())
{
// Update id address of the current cart if necessary
if ($address_old->isUsed())
if (isset($address_old) && $address_old->isUsed())
{
if ($this->context->cart->id_address_invoice == $address_old->id)
{
+2 -1
View File
@@ -262,6 +262,8 @@ class BlockCms extends Module
}
$helper = $this->initForm();
$helper->submit_action = '';
$helper->title = $this->l('CMS Block configuration');
$helper->fields_value = $this->fields_value;
$this->_html .= $helper->generateForm($this->fields_form);
@@ -649,7 +651,6 @@ class BlockCms extends Module
{
$this->_html = '';
$this->_postProcess();
$this->_html .= '<h2>'.$this->l('CMS Block configuration').'</h2>';
if (Tools::isSubmit('addBlockCMS') || Tools::isSubmit('editBlockCMS'))
$this->displayAddForm();