I am creating a ‘terms and conditions’ text area box to be used in an invoice/contract.
I want to it to have the default terms and conditions loaded as standard, but anyone can go in and change them as desired, but by default they are the basic terms.
I understand this can be solved by just the ‘default value’ field but this is too short and cuts off half the text.
Is there any way to solve this issue and achieve my aim through a different method?
It’s just occurred that you are creating a custom field. This will be stored in the default_value column of fields_meta_data in the database. Looking at this column shows that it is a varchar(255). A workaround for the moment would be to increase the size of this field.
I am having the very same problem here. The size of this database field (varchar (255)) is simply not enough when you use custom created text area fields.
I have implemented Jim’s solution and altered database column to varchar (max). Now everything is working properly except that I just lost upgrade safety! And I want to be able to upgrade when needed. And also I have this irritating error every time I do Repair and Rebuild:
[FATAL] Executing repair query: Query Failed:ALTER TABLE fields_meta_data ALTER COLUMN [default_value] nvarchar(255) NULL::: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]String or binary data would be truncated.
It is trying to alter field back to nvarchar(255) but fails when squeezing my text into it.
I am not sure if this field should have limited size but 255 is just too small for large text like Terms&Conditions or Warranty options or EULA etc.
I know that this texts could be added as an additional document aside but it is a lot more flexible if someone wants to change some parts of this text.
Use case for custom text area fields bigger than 255 is like when creating Quotes/Contracts with slightly different T&C and you want a user to be able to make this changes easily. The other way around is to make as many templates as you have possible differences in terms but this is not practical or to have as many 255 fields as needed chained one after another instead of one, again not practical.
Is there a way to vote for this change to be implemented in the future releases? Let’s say varchar(2000)…(who really need’s (max))?
The solution is in the following file:
What I did was: change line 57:
‘default_value’=>array(‘name’ =>‘default_value’, ‘type’ =>‘text’, ‘length’=>‘65500’, ),
and in the phpmyadmin, in the table fields_meta_data change the data type to text
then i repaired
this worked for me
In the same way, I think that only changing the vardef and repairing it reaches