Skip to content
Snippets Groups Projects

#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
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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
14 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$';
  • added 1 commit

    • 20687afd - Review fix: Constant not being used anywhere else removed it

    Compare with previous version

  • added 1 commit

    • c13e168d - Review fix: Constant not being used anywhere else removed it

    Compare with previous version

  • 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$',
  • added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading