Not compatible with utfmb4

I’m running v7.13.1 with PHP v8.0 and mariadb v10.5 with utfmb4 because this is what’s advised now, security wise. I always had problems with my installation, and still have. But I solved one.

Every time I made a Quick Repair and Rebuild, I had this message at the bottom:

/* Table : emails_text */
/*INDEX MISMATCH WITH DATABASE - emails_textfromaddr -  ROW <name> emails_textfromaddr <type> index <fields>[0] => 'from_addr (250)'  */
/* VARDEF - emails_textfromaddr -  ROW<name> emails_textfromaddr <type> index <fields>[0] => 'from_addr'  */
ALTER TABLE emails_text   DROP INDEX emails_textfromaddr,  ADD INDEX emails_textfromaddr (from_addr);

Initially I clicked the Execute button, which obviously is not working because the message kept showing up, so the index was not dropped / created.

A while ago I decide to investigate and read on the logs that the index was not created because the column from_address is longer the 1000 bytes. Actually it is 255 characters which, on utf8 means 3*255 = 765 bytes maximum.

But, as I was using utfmb4, the maximum character with is 4 bytes, thus 4*255=1020 bytes wide, greater than 1000.

I converted the whole database to utf8, although contrary to the security advices, and the message was gone after the first Quick Repair.

Now, I’m only left with the impossibility to import emails, with a cryptic message:

An error has occurred

Nothing on suitecrm.log and on php_errors:

Uncaught TypeError: Unsupported operand types: string % int

on a template in the cache; difficult to track, at least for me.