venditdevs Posted April 30, 2014 Share Posted April 30, 2014 (edited) I managed to override IsGenericName() because i have to accept these chars < = > in the Feature values. I don't want to break other validations in Prestashop so the desired solution is to add a custom function for this purpose. How do i get Prestashop to use this function ? I can't find the use of Validate::IsGenericName() In the AdminFeaturesController.php but it is using it. Is there anyone who can help? Edited May 1, 2014 by venditdevs (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted April 30, 2014 Share Posted April 30, 2014 I think you should search it in classes/Feature.php and classes/FeatureValue.php: There you have definitions like this: public static $definition = array( 'table' => 'feature', 'primary' => 'id_feature', 'multilang' => true, 'fields' => array( 'position' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), // Lang fields 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128), ), ); and public static $definition = array( 'table' => 'feature_value', 'primary' => 'id_feature_value', 'multilang' => true, 'fields' => array( 'id_feature' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'custom' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), // Lang fields 'value' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 255), ), ); Which you can change into your own function 'isMyAdjustedGenericName' that you create in an override of classes/Validate.php, (or, you can just replace 'isGenericName' with 'isAnything' if you want it to accept just all chars) Hope this helps, pascal 1 Link to comment Share on other sites More sharing options...
venditdevs Posted May 1, 2014 Author Share Posted May 1, 2014 Thanks PascalVG you really saved me on this one Another challenge have risen now And i don't know where to look ...well ...i think it's a TPL file. I will explain in a new topic Thanks again for your help! Link to comment Share on other sites More sharing options...
PascalVG Posted May 1, 2014 Share Posted May 1, 2014 Glad it worked for you. Message me a link to the new topic, and if may have a look at it soon. Please mark the topic as solved (see my footer on how to) Pascal Link to comment Share on other sites More sharing options...
webconcept76 Posted March 3, 2017 Share Posted March 3, 2017 (edited) Hy Please, how enable HTML on the `delay` field of 'ps_carrier_lang` table. i've some html link in this field and i'm looking for their execution I've try with 'type' => self::TYPE_HTML, bot not execute as html 'delay' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isAnything', 'required' => true, 'size' => 628), Thank's Best regards Thomas Edited March 3, 2017 by webconcept76 (see edit history) Link to comment Share on other sites More sharing options...
waizrahman Posted June 25, 2017 Share Posted June 25, 2017 Hy Please, how enable HTML on the `delay` field of 'ps_carrier_lang` table. i've some html link in this field and i'm looking for their execution I've try with 'type' => self::TYPE_HTML, bot not execute as html 'delay' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isAnything', 'required' => true, 'size' => 628), Thank's Best regards Thomas pretty old topics , but just as a help for those who are still searching, in order to enable HTML, you have to use 'isCleanHTML' validation method. here is a complete list of PrestaSHop object model validation methods.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now