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 ...@@ -50,8 +50,14 @@ class country extends department
$attributesInfo = parent::getDepartmentAttributesInfo(_('country')); $attributesInfo = parent::getDepartmentAttributesInfo(_('country'));
unset($attributesInfo['location']); unset($attributesInfo['location']);
unset($attributesInfo['properties']['attrs'][3]); // category unset($attributesInfo['properties']['attrs'][3]); // category
/* Country c attribut cannot contain any underscore */ /* Replace Name field by country code */
$attributesInfo['properties']['attrs'][1]->setPattern('/^[a-z0-9\.-]+$/i'); $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; return $attributesInfo;
} }
} }
......
  • bmortier @bmortier

    mentioned in commit 87626c4f

    By Côme Chilliet on 2018-08-08T12:52:14 (imported from GitLab)

    ·

    mentioned in commit 87626c4f

    By Côme Chilliet on 2018-08-08T12:52:14 (imported from GitLab)

    Toggle commit list
  • bmortier @bmortier

    mentioned in commit b40e1fc1

    By Côme Chilliet on 2018-08-08T12:53:21 (imported from GitLab)

    ·

    mentioned in commit b40e1fc1

    By Côme Chilliet on 2018-08-08T12:53:21 (imported from GitLab)

    Toggle commit list
  • bmortier @bmortier

    mentioned in merge request !352

    By Côme Chilliet on 2018-08-08T12:53:22 (imported from GitLab)

    ·

    mentioned in merge request !352

    By Côme Chilliet on 2018-08-08T12:53:22 (imported from GitLab)

    Toggle commit list
  • bmortier @bmortier

    mentioned in merge request !351

    By Côme Chilliet on 2018-08-09T07:38:31 (imported from GitLab)

    ·

    mentioned in merge request !351

    By Côme Chilliet on 2018-08-09T07:38:31 (imported from GitLab)

    Toggle commit list
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