Automatically increase an attribute's database field length#2308
Automatically increase an attribute's database field length#2308fritzmg wants to merge 1 commit intoisotope:2.8from
Conversation
|
why not use the actual length? Maybe we need to include the length of existing database values as well? Also, doesn't it update the database automatically if you change an attribute configuration? |
There is no actual length as the back end input field has no maximum length. Or do you mean the actual length of the string instead of multiple values of
Probably, yes. But it's at least an improvement to before.
Yes, as I pointed out this would require you to update the database after you have changed the values. |
yes
uhm, why, if we update automatically? |
|
Does it already do that when you edit the options of an existing radio/select attribute? I didn't actually check 🙈 |
|
As far as I know it does, otherwise change if attribute types would not update the column. |
Currently if you have a select/radio attribute where the options are defined in the attribute itself, the database field that is created for
tl_iso_productwill have a hard coded length of64. However, this means that if you define an option with a value larger than 64 characters, it will lead to an exception in the back end when trying to save the product with that option, as it won't fit into the database field.This PR solves that by increasing the length of the database field (by multiples of 64) dynamically, according to the option's value lengths. For this to apply you will need to update the database yourself though after you have entered all the possible options for your attribute (via the Install Tool or
contao:migrate).