// BugFix - Changing error message "name is to long (32 chars max)" + Adding context to Tools::displayError()

This commit is contained in:
mDeflotte committed 2011-12-20 14:06:57 +00:00
1 parent e33326c990
commit 5b661db25d
4 files changed
+9 -6

No files matched your search

+3
View File
@@ -634,6 +634,9 @@ class ToolsCore
{ {
global $_ERRORS; global $_ERRORS;
if (is_null($context))
$context = Context::getContext();
@include_once(_PS_TRANSLATIONS_DIR_.$context->language->iso_code.'/errors.php'); @include_once(_PS_TRANSLATIONS_DIR_.$context->language->iso_code.'/errors.php');
if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_ AND $string == 'Fatal error') if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_ AND $string == 'Fatal error')
@@ -328,7 +328,7 @@ class AdminProductsControllerCore extends AdminController
if (!Validate::isGenericName(Tools::getValue('attachment_name_'.(int)($language['id_lang'])))) if (!Validate::isGenericName(Tools::getValue('attachment_name_'.(int)($language['id_lang']))))
$this->_errors[] = Tools::displayError('Invalid Name'); $this->_errors[] = Tools::displayError('Invalid Name');
else if (Tools::strlen(Tools::getValue('attachment_name_'.(int)($language['id_lang']))) > 32) else if (Tools::strlen(Tools::getValue('attachment_name_'.(int)($language['id_lang']))) > 32)
$this->_errors[] = Tools::displayError('Name is too long'); $this->_errors[] = Tools::displayError('Name is too long.').' '.'(32 '.Tools::displayError('chars max').')';
if (!Validate::isCleanHtml(Tools::getValue('attachment_description_'.(int)($language['id_lang'])))) if (!Validate::isCleanHtml(Tools::getValue('attachment_description_'.(int)($language['id_lang']))))
$this->_errors[] = Tools::displayError('Invalid description'); $this->_errors[] = Tools::displayError('Invalid description');
} }
@@ -1100,7 +1100,7 @@ class AdminTranslationsControllerCore extends AdminController
'limit_warning' => $this->displayLimitPostWarning($count), 'limit_warning' => $this->displayLimitPostWarning($count),
'suoshin_exceeded' => $this->suhosin_limit_exceed, 'suoshin_exceeded' => $this->suhosin_limit_exceed,
'url_submit' => self::$currentIndex.'&submitTranslationsErrors=1&token='.$this->token, 'url_submit' => self::$currentIndex.'&submitTranslationsErrors=1&token='.$this->token,
'auto_translate' => $this->displayAutoTranslate(), 'auto_translate' => '',
'type' => 'errors', 'type' => 'errors',
'errorsArray' => $stringToTranslate 'errorsArray' => $stringToTranslate
); );
@@ -1163,7 +1163,7 @@ class AdminTranslationsControllerCore extends AdminController
'suoshin_exceeded' => $this->suhosin_limit_exceed, 'suoshin_exceeded' => $this->suhosin_limit_exceed,
'url_submit' => self::$currentIndex.'&submitTranslationsFields=1&token='.$this->token, 'url_submit' => self::$currentIndex.'&submitTranslationsFields=1&token='.$this->token,
'toggle_button' => $this->displayToggleButton(), 'toggle_button' => $this->displayToggleButton(),
'auto_translate' => $this->displayAutoTranslate(), 'auto_translate' => '',
'tabsArray' => $tabs_array, 'tabsArray' => $tabs_array,
'missing_translations' => $missing_translations, 'missing_translations' => $missing_translations,
'textarea_sized' => TEXTAREA_SIZED, 'textarea_sized' => TEXTAREA_SIZED,
@@ -1512,7 +1512,7 @@ class AdminTranslationsControllerCore extends AdminController
'suoshin_exceeded' => $this->suhosin_limit_exceed, 'suoshin_exceeded' => $this->suhosin_limit_exceed,
'url_submit' => self::$currentIndex.'&submitTranslationsMails=1&token='.$this->token, 'url_submit' => self::$currentIndex.'&submitTranslationsMails=1&token='.$this->token,
'toggle_button' => $this->displayToggleButton(), 'toggle_button' => $this->displayToggleButton(),
'auto_translate' => $this->displayAutoTranslate(), 'auto_translate' => '',
'type' => 'mails', 'type' => 'mails',
'tinyMCE' => $this->getTinyMCEForMails($obj_lang->iso_code), 'tinyMCE' => $this->getTinyMCEForMails($obj_lang->iso_code),
'mail_content' => $this->displayMailContent($core_mails, $subject_mail, $obj_lang, 'core', $this->l('Core e-mails')), 'mail_content' => $this->displayMailContent($core_mails, $subject_mail, $obj_lang, 'core', $this->l('Core e-mails')),
@@ -1799,7 +1799,7 @@ class AdminTranslationsControllerCore extends AdminController
'suoshin_exceeded' => $this->suhosin_limit_exceed, 'suoshin_exceeded' => $this->suhosin_limit_exceed,
'url_submit' => self::$currentIndex.'&submitTranslationsPdf=1&token='.$this->token, 'url_submit' => self::$currentIndex.'&submitTranslationsPdf=1&token='.$this->token,
'toggle_button' => $this->displayToggleButton(), 'toggle_button' => $this->displayToggleButton(),
'auto_translate' => $this->displayAutoTranslate(), 'auto_translate' => '',
'textarea_sized' => TEXTAREA_SIZED, 'textarea_sized' => TEXTAREA_SIZED,
'type' => 'pdf', 'type' => 'pdf',
'tabsArray' => $tabs_array, 'tabsArray' => $tabs_array,
@@ -69,7 +69,7 @@ class GuestTrackingControllerCore extends FrontController
else if (!Validate::isLoadedObject($order)) else if (!Validate::isLoadedObject($order))
$this->errors[] = Tools::displayError('Invalid Order ID'); $this->errors[] = Tools::displayError('Invalid Order ID');
else if (!$order->isAssociatedAtGuest($email)) else if (!$order->isAssociatedAtGuest($email))
$this->errors[] = Tools::displayError('123'); $this->errors[] = Tools::displayError('Invalid order ID');
else else
{ {
$this->assignOrderTracking($order); $this->assignOrderTracking($order);