When storing the computed field on the database, if one selects the "text" data type, then the data length should not be required (because the "text" type doesn't need a length).
Currently, if you use a "text" field and doesn't specify a data length, when you save the field the module complains with the message "to store this field in the database, please specify the data length."
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | computed_field_longtext.patch | 1.33 KB | mlncn |
Comments
Comment #1
mlncn commentedThis is absolutely correct, and in fact prevents the longtext capability from being used at all to save computed fields, which is a limitation for this CCK teaser workaround.
Giving a value produces error messages like this one:
So here's a patch. It is applied against the dev branch (which for computed_field.module is the same as the 4.7.x-1.0 official release).
It removes the check for data length when the data type is
text, and it borrows from CCK's text.module the bit about setting the longtext type.The patch may be closer to "code needs work" than "code needs review" but at this point in 4.7's long life, it's more important to be functional than to be sure there's no redundant check for data length.
Agaric has tested this patch. Feedback on everything, including if the patch file is made correctly, much appreciated.
~ ben, Agaric Design Collective, Open Source Web Development
Comment #2
wrunt commentedThanks Ben, I've comitted a fix for this based on your patch.
Comment #3
(not verified) commented