handle mediumtext type used in comments#433
Conversation
Comments use mediumtext type Add 'form-control' class to get the correct style for comments
stonebuzz
left a comment
There was a problem hiding this comment.
GLPI currently does not support using the MEDIUMTEXT type—it is automatically normalized to TEXT.
We normalize all MEDIUMTEXT and LONGTEXT fields to TEXT by design.
Unless, of course, you haven't migrated your database to use_utf8mb4.
|
Hi, do you mean there must be something wrong in my GLPI configuration to need that change ? |
|
Have you a message on central page for "use_utf8mb4" ? |
|
I do not see use_utf8mb4 on the central page, even with debug activated |
|
I've tried to check and it seems all my glpi columns are using utf8mb4 and a lot of them are indeed MEDIUMTEXT. config_db.php does have This PR basically adds MEDIUMTEXT type handling next to TEXT and LONGTEXT. I would guess if LONGTEXT is handled, then MEDIUMTEXT should be handled too from what I understand ? (or both should not be handled at all) |
|
The plugin does not allow the addition of fields with the "mediumtext" data type. |
|
Default Have you added your own |
I can confirm : |
No, the only additional field (using the additional field plugin) I have is about storage location. Sound like something went a bit wrong in my database over the years. Should the solution be to change the column types to "text" instead of "mediumtext" ? I'm wondering why largetext is present in the plugin however, is that supposed to happen too ? |
Yes, the plugin currently uses the |
|
It's always difficult to know how this kind of issue comes... It may depends on which db (maria/mysql) or version used. Anyway - even if this should not happen - I guess the proposed patch could be accepted; since it does not seem it can really break anything. @stonebuzz your opinion? Also, now you know your database is incorrect, you should also consider fixing it ;) |
I agree with that as well. The scope is indeed quite limited. |
|
I will fix my DB then and try to investigate from the backups I have if I can find a culprit. |
Comments are not correctly displayed in generic objects:
Checklist before requesting a review
Please delete options that are not relevant.
Description
Screenshots (if appropriate):
without fix:


with fix: