Skip to content

url_title generated by ee('Format') urlSlug method fails validation (EE7.4.5) #4246

Description

@jcogs-design

Description of the problem
Am auto-generating url_title elements for channel entries in an add-on.
Using the following to generate the url_title element


$url_title = substr(ee('Format')->make('Text', $data_item)->urlSlug(['remove_stopwords' => TRUE])->compile(),0,199);

This generates url_title elements such as acrandjute30m-acoustix-jute-randstrook-30-lm*5mm*100mm-uitlopend from a source string of ACRANDJUTE30M-Acoustix jute randstrook 30 lm*5mm*100mm uitlopend.
Unfortunately this url_title fails to validate - this is the result of validating a new channel entry using this url_title


object(ExpressionEngine\Service\Validation\Result)[2675]
  protected 'default_view' => null
  protected 'line_view' => null
  protected 'failed' => 
    array (size=1)
      'url_title' => 
        array (size=1)
          0 => 
            object(ExpressionEngine\Service\Validation\Rule\AlphaDashPeriodEmoji)[36495]
              ...

This appears to be a bug.

How To Reproduce
Hopefully the above explanation is clear enough.

Environment Details:

  • Version: 7.4.5
  • PHP Version 8.1.13
  • MySQL Version MariaDb 10.4.27
  • Web Server: nginx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions