#3428652 - fix js error in Date Formats machine name generation when using accented characters in label
Open
#3428652 - fix js error in Date Formats machine name generation when using accented characters in label
2 unresolved threads
Open
requested to merge issue/drupal-3428652:fix/3428652d-date_format_machine_name_pattern_replacement into 11.x
2 unresolved threads
Fixes :
- Javascript error in ajax callback for machine name generation when using non-ASCII accented chars in label (such as
åäöÅÄÖš
).
Adds:
- TestCase related to said characters in machine name
Merge request reports
Activity
added 1 commit
added 629 commits
Toggle commit list14 14 */ 15 15 abstract class DateFormatFormBase extends EntityForm { 16 16 17 /** 18 * Pattern used for preg_replace when generating machine name. 19 * 20 * Replaces capital characters & accented chars (à, â, å etc.) & reserved 21 * keyword custom. 22 * 23 * @var string 24 */ 25 public const REPLACE_PATTERN = '[^A-Za-zÀ-ÖØ-öø-ÿ0-9_]+|^custom$'; changed this line in version 4 of the diff
added 1 commit
- 20687afd - Review fix: Constant not being used anywhere else removed it
added 1 commit
- c13e168d - Review fix: Constant not being used anywhere else removed it
88 88 '#default_value' => $this->entity->id(), 89 89 '#machine_name' => [ 90 90 'exists' => [$this, 'exists'], 91 'replace_pattern' => '([^a-z0-9_]+)|(^custom$)', 91 'replace_pattern' => '[^A-Za-zÀ-ÖØ-öø-ÿ0-9_]+|^custom$', changed this line in version 6 of the diff
Nice catch @nod_ , I changed the pattern based on your recommandation, thanks !
added 1 commit
Please register or sign in to reply