Nico Knoll Posted June 25, 2014 Share Posted June 25, 2014 Hey, is there a maximum of how many characters are allowed in a textarea field? Because it looks like I only can include a specific amount of characters in my body-field.... -- Nico Link to comment Share on other sites More sharing options...
LostKobrakai Posted June 25, 2014 Share Posted June 25, 2014 The body field is saved to field_body.data which is a mediumtext field in mysql. I don't know how much characters are allowed in these, but these fieldtypes all got their limits. Link to comment Share on other sites More sharing options...
Nico Knoll Posted June 25, 2014 Author Share Posted June 25, 2014 Okay so I think I have to change it in MySQL I guess Changed it to "longtext" but I still can't add more characters... Link to comment Share on other sites More sharing options...
LostKobrakai Posted June 25, 2014 Share Posted June 25, 2014 If you need more space, yes. Shouldn't matter, as long as you don't change the database schema of the field afterwards. Look here for the different sizes: http://stackoverflow.com/questions/6766781/maximum-length-for-mysql-type-text Edit: The other way around would be a second fieldtype_textarea, where you could change the database schema in the module itself. I thinks that's the better way of solving this. Link to comment Share on other sites More sharing options...
Raymond Geerts Posted June 25, 2014 Share Posted June 25, 2014 There is a software limitation applied by the sanitizer. For textarea fields this limit is 16384 characters. https://processwire.com/api/variables/sanitizer/ http://cheatsheet.processwire.com/sanitizer/properties-and-methods/sanitizer-textarea-value-options/ 4 Link to comment Share on other sites More sharing options...
Soma Posted June 25, 2014 Share Posted June 25, 2014 Textarea sanitizes length I think. So changing db doesn't have an effect. Link to comment Share on other sites More sharing options...
Nico Knoll Posted June 25, 2014 Author Share Posted June 25, 2014 Would be nice to have a "maxlength" option for textareas which would change the database field type automatically to medium text or longtext. Link to comment Share on other sites More sharing options...
LostKobrakai Posted June 25, 2014 Share Posted June 25, 2014 I think the sanitizer is the bigger bottleneck as the mysql fieldsize, as mediumtexts can already hold ~16.000.000 bytes of data, while the sanitizer limits to 16.000 chars by default. Could be that this was a consideration of performance to not allow more by default. Link to comment Share on other sites More sharing options...
adrian Posted June 25, 2014 Share Posted June 25, 2014 I don't think I have ever needed more than a standard mysql text field. 65,000 bytes is a lot already. Jeez, that's the same as the total RAM of my first computer Type | Maximum length -----------+------------------------------------- TINYTEXT | 255 (2 8−1) bytes TEXT | 65,535 (216−1) bytes = 64 KiB MEDIUMTEXT | 16,777,215 (224−1) bytes = 16 MiB LONGTEXT | 4,294,967,295 (232−1) bytes = 4 GiB 4 Link to comment Share on other sites More sharing options...
Nico Knoll Posted June 25, 2014 Author Share Posted June 25, 2014 Hmm... It's only 16.400 bytes. Don't know why it isn't working then... Edit: It breaks after 8000 bytes... Link to comment Share on other sites More sharing options...
Nico Knoll Posted June 25, 2014 Author Share Posted June 25, 2014 Edit 2: Found the problem. It's a bug in my Quick Tags Editor... 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now