- Posts: 2696
- Thank you received: 74
champ perso Please specify a correct attribute
10 years 7 months ago #230022
by erickb
champ perso Please specify a correct attribute was created by erickb
-- HikaShop version -- : 261
-- Joomla version -- : 348
-- Error-message(debug-mod must be tuned on) -- : Please specify a correct attribute
Bonjour
dans les Attributes des champs perso il est impossible d'avoir un - (tiret)
datahidden="off" marche , mais pas data-hidden="off" ce qui fait qu'on ne peut pas utiliser de data-attributes qui doivent tous etre prefixés de data-, et les recuperer par exemple en jquery avec .data()
-- Joomla version -- : 348
-- Error-message(debug-mod must be tuned on) -- : Please specify a correct attribute
Bonjour
dans les Attributes des champs perso il est impossible d'avoir un - (tiret)
datahidden="off" marche , mais pas data-hidden="off" ce qui fait qu'on ne peut pas utiliser de data-attributes qui doivent tous etre prefixés de data-, et les recuperer par exemple en jquery avec .data()
Please Log in or Create an account to join the conversation.
10 years 7 months ago #230089
by Farida
Replied by Farida on topic champ perso Please specify a correct attribute
Bonjour,
En effet les attributs comportant un tiret ne sont pas acceptés. Afin qu'il soit possible d'ajouter un tiret à vos attributs il vous suffit de remplacer dans le fichier administrator\components\com_hikashop\classes\field.php
la ligne suivante :
if(!preg_match('#^([a-z0-9_]+ *= *"[\p{L}\p{N}\p{Z} ]+" *)* *$#i', $fieldOptions)){
par celle-ci :
if(!preg_match('#^([a-z0-9_-]+ *= *"[\p{L}\p{N}\p{Z} ]+" *)* *$#i', $fieldOptions)){
En effet les attributs comportant un tiret ne sont pas acceptés. Afin qu'il soit possible d'ajouter un tiret à vos attributs il vous suffit de remplacer dans le fichier administrator\components\com_hikashop\classes\field.php
la ligne suivante :
if(!preg_match('#^([a-z0-9_]+ *= *"[\p{L}\p{N}\p{Z} ]+" *)* *$#i', $fieldOptions)){
par celle-ci :
if(!preg_match('#^([a-z0-9_-]+ *= *"[\p{L}\p{N}\p{Z} ]+" *)* *$#i', $fieldOptions)){
Please Log in or Create an account to join the conversation.
10 years 7 months ago - 10 years 7 months ago #230113
by erickb
Replied by erickb on topic champ perso Please specify a correct attribute
et ce sera inclus dans les prochains correctifs ? car bien sur tous les data-attributes prennent un tiret, sans ça on ne peut pas utiliser ce champ attributs
merci pour l'aide
merci pour l'aide
Code:
$attributes = '#^([a-z0-9_-]+ *= *"[\p{L}\p{N}\p{Z} ]+" *)* *$#i';
if(!preg_match($attributes, $fieldOptions['attribute'])){
$this->errors[] = 'Please specify a correct attribute';
return false;
}
Last edit: 10 years 7 months ago by erickb.
Please Log in or Create an account to join the conversation.
10 years 7 months ago #230141
by Farida
Replied by Farida on topic champ perso Please specify a correct attribute
Oui, cela sera corrigé dans la prochaine release.
Please Log in or Create an account to join the conversation.
10 years 7 months ago #230155
by erickb
Replied by erickb on topic champ perso Please specify a correct attribute
genial !
merci
merci
Please Log in or Create an account to join the conversation.
Time to create page: 0.200 seconds