With MYSQL 5.6 reaching EOL we were forced to upgrade our hosting machine to the 5.7 version.
This operation broke the Gallery plugin, which i’m not very fond of, but is used in a lot of older websites prior to switching almost completely to ContentBlocks for content management.
Step to reproduce
- From the Components menu go to Gallery and open any gallery
- Where the images should be shown it’s an error message that no file satisfies the search filter.
Looking around the web i’ve found a post that states to add this line:
$this->pdo->exec("SET SESSION sql_mode = 'NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';");
This actually resolves the issue (screenshot is the same gallery shown earlier, after applying the patch)
The core editing solutions feels very hacky and not really future-proof and I’m wondering if there’s a better approach, considering we have dozens of websites suffering from this issues and applying this patch manually on every one is pretty time consuming.
MODX versions varying from 2.6.5 to 2.7.3