Commit 89af097f authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(country) Country c field is not a name but a two-letter country code

This will make sure the user enter a valid value to avoid invalid DN
 syntax errors.

issue #5864
Showing with 8 additions and 2 deletions
+8 -2
......@@ -50,8 +50,14 @@ class country extends department
$attributesInfo = parent::getDepartmentAttributesInfo(_('country'));
unset($attributesInfo['location']);
unset($attributesInfo['properties']['attrs'][3]); // category
/* Country c attribut cannot contain any underscore */
$attributesInfo['properties']['attrs'][1]->setPattern('/^[a-z0-9\.-]+$/i');
/* Replace Name field by country code */
$attributesInfo['properties']['attrs'][1] =
new StringAttribute(
_('Country code'), _('A two-letter country code from ISO 3166'),
static::$namingAttr, TRUE,
'', '',
'/^[a-z0-9\.-]{2}$/i', 'IT'
);
return $attributesInfo;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment