CMS MADE SIMPLE FORGE

LISE

 

[#12764] Generate alias can create an alias that cannot be used

avatar
Created By: Chris Taylor (chrisbt)
Date Submitted: Wed Nov 20 03:21:52 -0500 2024

Assigned To: Fernando Morgado (JoMorg)
Version: 1.5.6
CMSMS Version: 2.2.21
Severity: Minor
Resolution: None
State: Open
Summary:
Generate alias can create an alias that cannot be used
Detailed Description:
Alias needs to start with a letter. If the title starts with a number e.g. '10
years ...' GenerateAlias creates an alias that starts '10-years...'. I just did
the following but I suspect there are more elegant solutions :)

            if (empty($lise_item->alias)) {
                // if title starts with a number, add an 'a_'
                $alias = preg_replace('/^(\d)/', 'a_$1', $lise_item->title);
$lise_item->alias = api::GenerateAlias($alias,
$this->instance_name );
            }


History