Grid columns with optional fields are editable but can't save

To reproduce, open Mp3Tag on a folder with usual single-track files with track numbers filled in.

Create a column:

  • Name: №
  • Value: [CD%discnumber% - ]%track%
  • Field: [CD%discnumber% - ]%track%

Values from this column appear to be editable when clicked (at least when only track number is present, but not discnumber). However pressing Enter doesn't save the (numeric) value as track number. Of course if Field is just "%track%", behavior is as expected (editable and saved).

I'd suggest to prohibit such optional fields since they mislead users into thinking one can edit two fields in one control.

Yet, if one looks closely, the label for that input is "Field", singular, not "Fields", plural.
Also, the help states:

Field

This field is optional. The placeholder of this field is used for editing the content of the field through the file view - if this field is empty, the column is write protected.
You can only use placeholders for tag fields (e.g. %artist%), %_filename_ext%, or %_filename% here.

So your idea with square brackets plus a text constant "CD" is invalid syntax ...
On the other hand, the free user input is required as user-defined fields could be created like that.

I agree I should have read more closely. In fact, it was just a copy-paste from "Value" happened years ago :slight_smile:
However I still feel some error checking can be present. E.g. both "track" and "%track%" work, but "track " of course doesn't. Initially I though only strings within %s are field names and so no "free" user input is required.

Glad you told me, now I need to clear some new fancy fields I created like "[CD%DISCNUMBER% - ]%TRACK" :joy: