bolt / core

🧿 Bolt 5 core
https://boltcms.io
MIT License
542 stars 159 forks source link

Select field values format does not allow "/" #2503

Open nestordedios opened 3 years ago

nestordedios commented 3 years ago

Hi everyone!

I've noticed that when formatting the values of a Select field it does not allow to use the slash (/) to format the values of the select list.

Details

Question Answer
Relevant Bolt Version 5.0 beta 3
Install type Composer install
BC Break yes/no
PHP version 7.2 / 7.3 / 7.4
Web server Symfony local server

Reproduction

book:
            label: Book
            type: select
            values: books/{id} / {title}
            keys: id
            autocomplete: true
            sort: -id
            class: narrow
            variant: inline
            required: true

Expected result

Select values with / in the format pattern, which would give values like "35 / The mist" for example.

Actual result

Although this is not breaking the edit page in the CMS, the values are being displayed like "35 " for example, missing part of the format,.

I-Valchev commented 3 years ago

@nestordedios it's a valid point, I do feel that if we go ahead to fix it, it will make parsing the select values more difficult. And because we don't have a standardised place to do so (for example, it's in core but now you also added it in conimex, and likely it's in other places), it'll probably take more effort that it's worth.

Alternatives can be to use something like :, ) and \

nestordedios commented 3 years ago

I agree with you @I-Valchev. I personally don't mind using other characters to format the values.

I just opened this issue because when migrating a site from Bolt 3 to Bolt 4 I noticed the values in Bolt 3 were formatted with the / and this is lost in Bolt 4.

I-Valchev commented 3 years ago

👍 Let's keep it open, also for people who might bump into this in future, we can refer to this :-)