chamilo-lms icon indicating copy to clipboard operation
chamilo-lms copied to clipboard

Text area extra field only saved partially

Open ric373 opened this issue 7 years ago • 5 comments

Current behavior / Resultado actual / Résultat actuel

When inserting multiple sentences (500+ characters) into an extra field (type: text area) only part of it is saved.

Expected behavior / Resultado esperado / Résultat attendu

The whole text is saved.

Steps to reproduce / Pasos para reproducir / Étapes pour reproduire

Create an extra field (type: text area). Create or edit a course and type multiple sentences into the extra field and save the form.

Chamilo Version / Versión de Chamilo / Version de Chamilo

1.11.2

ric373 avatar May 22 '17 09:05 ric373

This will require a database change currently the field ('value') allows max 255 characters

mysql> describe extra_field_values;
+------------+--------------+------+-----+---------+----------------+
| Field      | Type         | Null | Key | Default | Extra          |
+------------+--------------+------+-----+---------+----------------+
| id         | int(11)      | NO   | PRI | NULL    | auto_increment |
| value      | varchar(255) | YES  |     | NULL    |                |
| field_id   | int(11)      | YES  | MUL | NULL    |                |
| item_id    | int(11)      | NO   |     | NULL    |                |
| comment    | longtext     | YES  |     | NULL    |                |
| created_at | datetime     | NO   |     | NULL    |                |
| updated_at | datetime     | NO   |     | NULL    |                |

Maybe it will be a good idea to change it to "text" in next version .... @ywarnier ?

jmontoyaa avatar May 22 '17 09:05 jmontoyaa

Yes, no problem to increase it to text from my perspective. It will weight a little on efficiency, but I understand that extra fields can be used more from now on... and they are not particularly efficiency-focused for now (if you want efficiency, then it should be added to core).

ywarnier avatar May 22 '17 15:05 ywarnier

This problems occurs for various plateform and as Yannick indicated the extrafields are not on efficiency based so we should change value from varchar(255) to text. Julio can you change it for 2.0

NicoDucou avatar Mar 09 '18 15:03 NicoDucou

Looks good to me, although I didn't test it (impossible at the moment). Requires a bit of testing and then we can close.

ywarnier avatar Dec 03 '20 22:12 ywarnier

I just tested the migration from 1.11 and see extra_fiel_value. value is changed to longtext .

christianbeeznest avatar Jun 23 '22 04:06 christianbeeznest

It is fixed in this commit https://github.com/chamilo/chamilo-lms/commit/320f89bb591b1aa896d22ad822b118ae1283ccbc Tested for migration too.

christianbeeznest avatar Aug 18 '22 04:08 christianbeeznest