Skip to content

Commit

Permalink
[import] remove spaces from ID
Browse files Browse the repository at this point in the history
  • Loading branch information
rastislav-chynoransky committed Jan 17, 2025
1 parent 974b63b commit d0d5a9e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Importers/UpmImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ protected function init()
protected function getItemId(array $record)
{
return 'CZE:UPM.' . str($record['ID'])
->replace(' ', '')
->explode('_')
->transform(fn ($part) => str($part)
->replaceMatches('/\W/', '-')
Expand All @@ -75,6 +76,7 @@ protected function getItemId(array $record)
protected function getItemImageFilenameFormat(array $record): string
{
return str($record['ID'])
->replace(' ', '')
->explode('_')
->transform(fn ($part) => '0*' . preg_quote($part))
->join('_') . '(_.*)?';
Expand Down

0 comments on commit d0d5a9e

Please sign in to comment.