![]() |
|
Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) (/thread-13786.html) |
Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - david1pro - 23-12-2022 I've had this problem since 1.59 (my first install). On a fresh install of 1.6.1a, I can enable the favorites plugin and it will then show the favorites link and add the favorites buttons. However, as soon as any user selects their first favorite, the site crashes - instantly - on the front end and that user is no longer able to access the site. If you are not that user (such as opening the site in incognito mode in the browser so you're not logged in), the site still works. In reviewing the database, it does seem that the favorite is saved before the crash, as I can find the listing for it via phpMyAdmin under the column "zp_plugin_storage." By clicking "copy" to better view that entry, I can see: The database entry type is: favorites In viewing the logs in Zenphoto, there seem to be two error entries that are created, both at the same time (same timestamp to the second). They are: {2716924:Fri, 23 Dec 2022 17:30:45 GMT} WARNING: mysqli::query(): (HY000/3685): Illegal argument to a regular expression. in /home/(mysite)/zp-core/classes/class-dbmysqli.php on line 69 mysqli->query called from dbMySQLi->query (class-dbmysqli.php [69]) {2716924:Fri, 23 Dec 2022 17:30:45 GMT} USER ERROR: mysqli Error: ( SELECT trigger_error called from dbMySQLi->query (class-dbmysqli.php [80]) If you see anything that might be a hint, please let me know and I'll test anything you wish. Thanks! Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - acrylian - 23-12-2022 That's different than your other issue. I have seen that error before and we had a similar report for 1.6 with favorite. I thought we had fixed that. here the issue is that the regex is empty for some reason making it invalid. Thanks, the error messages help a lot. Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - kuzzzma - 03-07-2023 Have the same problem on 1.6.1a My error log shows: Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - acrylian - 03-07-2023 What mysql version are you using? All utf8mb4 in case we have some encoding issue? Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - kuzzzma - 03-07-2023 I've the same issue on several sites: encoding is the same: character_set_client: utf8mb4 Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - acrylian - 03-07-2023 I will try locally. Perhaps it is some MySQL 8 thing. Sadly I have no access to that. Locally I sadly still have 5.7 and our live site actually uses MariaDB 10.5.x. Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - acrylian - 03-07-2023 I cannot reproduce this or probably I don't know how. Do you have the "Multiple sets" options checked? As far as I see actually that regex is only needed in that case as then there is a serialized array in the aux column. Otherwise for single sets it is just the user name so a simple like actually would work. Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - kuzzzma - 03-07-2023 No multiple sites or multilingual support Settings for Favorites had no multiple sets checked, when I first encountered this: data in database table is similar to OP: I deleted the row from table and enabled multiple sets. Same error, but now aux contains "a:2:{i:0;s:7:"kuzzzma";i:1;s:4:"test";}" (test was the instance name) error.log is identical. If you want to test - I can give you access to my demo site & database for it, it has no sensitive info and I use it for testing themes only. Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - acrylian - 03-07-2023
Yes, that is the storage difference with multiple sets enabled I menationed (username and set name instead of user name only). Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - david1pro - 13-08-2023 At least I now know I'm not the only one with this exact issue. Hopefully acrylian takes kuzzzma's generous offer to use his demo site & database. I'd love for my family members to be able to save favorites. Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - acrylian - 15-08-2023 We will review this again. Test sites doe not help if we cannot savely reproduce things with the same conditions on our own test sites. Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - acrylian - 21-08-2023 Since I cannot reproduce it you need to try something for me. Please find line 28 in class-favorites.php:
Please change this to:
Basically that is just removing the $_zp->quote() call on the REGEX value as it adds single quotes for values while the first on "type" in the query uses double quotes. Perhaps your MySQL version is just more picky than mine…just like PHP 8+ is compare to older versions. Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - acrylian - 22-03-2024 Late follow up but do you perhaps use MySQL 8 on that install? Then this is – as we found out on https://forum.zenphoto.org/discussion/1411202/search-not-working#latest – probably due to syntax changes in MySQL 8. The 1.6.3a support build has an update for this. Untested because we don't have MySQL 8. Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - kuzzzma - 28-03-2024 @acrylian thanks for the info! I was able to test latest version (from Mar 23, 2024) with: and adding and removing favourites works now without causing error 500 Favorites Plugin crashes site with first save (1.6.1a and earlier on Dreamhost) - acrylian - 28-03-2024 Great, thanks for the confirmation! |