![]() |
|
Locale settings being lost repeatedly - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Translating (https://forum.zenphoto.org/forum-8.html) +--- Thread: Locale settings being lost repeatedly (/thread-11835.html) Pages:
1
2
|
Locale settings being lost repeatedly - Ipstenu - 21-06-2014 Zenphoto isn't retaining locale settings consistently https://cloud.githubusercontent.com/assets/807903/3347046/95ebd0fc-f8d2-11e3-9f6d-0038421a86c7.png Every time I log in anew, that gets wiped out. The only way to fix it is to go into settings (where I see that yes, I did too set it right) https://cloud.githubusercontent.com/assets/807903/3347048/b7a90688-f8d2-11e3-8331-2a37f0a1afbb.png And I hit apply at the bottom of the page. BUT. When I do that, it wipes out any language based settings for the page. So the email 'Name' of Zenphoto has to be reset. If I neglect to do this and go into an album to edit descriptions or names (which I do frequently), it will erase all the language based data for the page I just saved. Yes. Erase. Is there a place I can hard-code my locale in to lock this down? Locale settings being lost repeatedly - acrylian - 21-06-2014 I tried to reproduce it on my shared hosting test site, my local site and on zenphoto.org.
Zenphoto always stores all multilingual capable content in seralized arrays, basically one field for each language. On quite older versions it did switch between plain storage and serialzed arrays if multilingual mode was set. Then disabling multilingual would indeed erase content. It was changed therefore quite a while ago. Was this by chance old content? Did you ever use multilingual at all? Did you try to set a default language for the user you are logged in (on the user account)? That is stored in the database (administrators table > language). If the locale cannot be fetched it might be an issue on the server. Of course to for example use the French locale your server must have it installed, otherwise it cannot be fetched naturally. Generally servers have only the locales of their country as it seems at least over here (my live one has only German and English). But I am sure you know these things already :-) Are there really no errors in the server log? Locale settings being lost repeatedly - Ipstenu - 22-06-2014 So no, there is no place I can hard force a define of my language so no matter what it shuts up? I get that I'm an edge case (and it would be better if I find why and fix it), but I can see other reasons why someone would want to lock the language for the site down and prevent multiple languages (derp admins, etc). I tried setting this:
Which works, but it tells me that functions.php already defined it in the debug log ... wouldn't THAT make more sense to allow an override without editing core files? If the functions.php file had a check for is_defined, then it could be overridden. I've never had multilingual set as my French and Spanish are abysmall ;) In fact, English is the ONLY language set on my install (everything else is inactive). If I look at my profile, I have the American Flag, so it must be set. No other options exist. PHP says my language (and lang) is en_US Nothing in the error log for the server OR ZenPhoto. It's been baffling me ever since y'all switched from text to serialized input. I get WHY you did it, it's a totally awesome way to handle multiple languages. But it's an absolute PILL if it goes wrong, because it can wipe out your content. "Was this by chance old content? " Yes and no. Originally, yes, because ... all my content was old :) But the current setting (on the settings page) for the name of the email-from account (Zenphoto) gets wiped no matter what when I re-save that pages.... It's like it thinks it's supposed to be Multilingual and then not, and then yes again. How old is this? I forget how long I've been using ZenPhoto on this site, but at least since 2009. I have a note on my server that says I upgraded it at that time. The only other thing I've got is that I log in between two different computers fairly often and I'm behind a VPN half the time, so I have to log in more often than most people I suspect. I added Locale settings being lost repeatedly - acrylian - 22-06-2014 [quote]I get WHY you did it, it's a totally awesome way to handle multiple languages. But it's an absolute PILL if it goes wrong, because it can wipe out your content. I am sorry that I have no other idea right now what is going wrong on your install. Especially the content deletion is of course something that really should not happen. Just changing the language should not be able to do anything to content itself as that does not save anything. I can only assume that it was old content that never was updated and something went wrong when re-saving it. Although that should be covered. We realyl should have noticed that on our site as we have quite a bit of content ourselves. Maybe you could look up some old content how it is stored in the database, backup it and try to reproduce your issue? That would maybe give us a clue. [quote]So no, there is no place I can hard force a define of my language so no matter what it shuts up?
You can of course also "hack" the constant define to find out if that fixes it at all. If that doesn't as well, there must be something else really going wrong.
Locale settings being lost repeatedly - Ipstenu - 23-06-2014 [quote]I can only assume that it was old content that never was updated and something went wrong when re-saving it. I did the 'hack' (booooo hiss!) and it worked. So it's just not STICKING in the database. Insert Jackie Chan WTF face here. So it's 'broken' right now and I went to the DB and it clearly says there that the language is en_US which is even weirder Oh and I took a backup locally and tested. Same thing. (All users have US and only US as the flag option for language so there's nothing to check or change)
Locale settings being lost repeatedly - acrylian - 23-06-2014 The old content actually should work and be serialized on the next saving. Otherwise our own site would have some problems as well… Really weird issue I wish I had a proper idea to and could even reproduce… I am sorry that I am a bit clueless right now. Wild guess would be the lovely issue with form processing going wrong because of too many form elements to post. But on that options page…? And there probably should be an error as well… Strange with the encoding of the log as well. Did you test what the locale constant actually says on theme pages? Maybe that gives us a clue where it gets lost or something. Locale settings being lost repeatedly - sbillard - 23-06-2014 Are the characters wrong in the debug log or just in the post? can you look in your database options table for the option "locale" and in your browser cookies for the cookie "dynamic_locale" and report their values? Maybe also clear the "dynamic_locale" cookie and see if it helps. Locale settings being lost repeatedly - Ipstenu - 23-06-2014 Tried with a fresh install on the same server: [quote]PHP setlocale() failed Locale functionality is not implemented on your platform or the specified locale does not exist. Language translation may not work. Locale settings being lost repeatedly - acrylian - 23-06-2014 That would explain some issue but of course not really why you got content erased… Locale settings being lost repeatedly - sbillard - 23-06-2014 I did try to simulate this failure on my builds. Could not reproduce your problem. So if you cannot get setlocale() to work correctly you might want to try the master branch of ZenPhoto20 and see if it works. Locale settings being lost repeatedly - Ipstenu - 23-06-2014 My guess is that when there's no locale detectable, it's not actually failing back to anything so it's unable to save the serialized data? When I check via shell:
But if I toss
From man setlocale on my box: The locale "C" or "POSIX" is a portable locale; its LC_CTYPE part corresponds to the 7-bit ASCII character set. This may be endemic to my OS/PHP setup? http://bugs.centos.org/view.php?id=3187 sigh Not sure how to force that around. Same thing happens on ZenPhoto20 Locale settings being lost repeatedly - Ipstenu - 23-06-2014 [quote]1. The general language option: options table > locale ( [/quote] Locale settings being lost repeatedly - acrylian - 23-06-2014 Maybe just ask your host to install the locale… Shared hosts here I know have all the local one (de_DE) by default and mine installed a en_US one they forgot after a server upgrade in minutes. Locale settings being lost repeatedly - acrylian - 23-06-2014 You can use that on any theme page directly or even better your theme's functions.php (like you do these things on WP ;-)). on the cfg. file you cannot do anything like that, too early in the chain. Locale settings being lost repeatedly - Ipstenu - 23-06-2014 It's a VPS :) So technically I can install everything I want. But ... it HAS the locale, is the thing! It's set to en_US like it should be and the local is installed and working. It's just kicking setlocale weirdly. I have a ticket in to see if they can make any more sense of it. functions.php didn't work so I put it in themeoptions.php and THAT seemed to make both the installer and the admin happy. fingers crossed for now Locale settings being lost repeatedly - sbillard - 23-06-2014 [quote]But if I toss echo setlocale(LC_ALL, 0); into a php file, it kicks back C. I would still like to know what the 'dynamic-locale' cookie value was. Locale settings being lost repeatedly - Ipstenu - 24-06-2014
The dynamic-locale cookie value is Locale settings being lost repeatedly - acrylian - 24-06-2014 Right, my fault, theme's functions.php is probably too late to change the option for everything. themeoptions.php comes earlier. At least good if that works for now. The dynamic locale cookie looks not correct. Makes sort of sense if there is no locale sticking… Locale settings being lost repeatedly - Ipstenu - 24-06-2014 Nope, I don't know either, so I have an open ticket with my host and politely asked my frind who IS a server guru :) Locale settings being lost repeatedly - acrylian - 24-06-2014 Ok, keep us posted what those two may find out. |