// Copy from trunk: #PSCFI-4401 - linebreaks in product return message cause fatal error in BO

This commit is contained in:
tDidierjean
2011-12-12 11:07:46 +00:00
parent 557df6b933
commit eae3bc761f
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -65,7 +65,8 @@ class OrderReturnCore extends ObjectModel
$fields['state'] = pSQL($this->state); $fields['state'] = pSQL($this->state);
$fields['date_add'] = pSQL($this->date_add); $fields['date_add'] = pSQL($this->date_add);
$fields['date_upd'] = pSQL($this->date_upd); $fields['date_upd'] = pSQL($this->date_upd);
$fields['question'] = pSQL(Tools::nl2br($this->question), true); // we don't want to use nl2br now because <br> will not pass Validation::isMessage()
$fields['question'] = pSQL($this->question, true);
return $fields; return $fields;
} }
+3 -1
View File
@@ -134,9 +134,11 @@ class AdminReturnControllerCore extends AdminController
} }
} }
/* Classic products */ // Classic products
$products = OrderReturn::getOrdersReturnProducts($this->object->id, $order); $products = OrderReturn::getOrdersReturnProducts($this->object->id, $order);
// Prepare customer explanation for display
$this->object->question = nl2br($this->object->question);
$this->tpl_form_vars = array( $this->tpl_form_vars = array(
'customer' => new Customer($this->object->id_customer), 'customer' => new Customer($this->object->id_customer),