ryan Posted March 11, 2022 Share Posted March 11, 2022 ProcessWire 3.0.196 contains 10 minor issue fixes, but the biggest additions this week are 6 pull requests submitted from @bernhard. This most notable PR is an upgrade to AdminThemeUikit that enables greater customization of the theme's markup. If you recall, Bernhard also provided a PR last year that enables customization of the admin theme's CSS/LESS, so now he's now completed the circle and provided us with a direction for customizing the markup as well. This newest addition lets you provide your own custom render files for different parts of the admin theme by placing them in /site/templates/AdminThemeUikit/. Third party modules can also define custom render files. Furthermore, this addition adds a new hook that enables you (or your modules) to hook into and modify just about any part of the admin theme rendering. Rather than going into all the details and repeating all of the instructions here, see the new AdminThemeUikit README file "Customizing Markup" section which describes all of the different things you can modify and how to do so. You can also find all of the render files in the core AdminThemeUikit directory — any .php files beginning with an underscore are custom render files that can be overridden. While not as broad in scope, there were other useful PRs added this week as well, so be sure to see the dev branch commit log if you are interested in seeing what else was added. Thanks for reading and have a great weekend. 24 2 Link to comment Share on other sites More sharing options...
adrian Posted March 11, 2022 Share Posted March 11, 2022 This looks awesome - thanks @bernhard and @ryan 7 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted March 11, 2022 Share Posted March 11, 2022 Whoa! That is something I was wishing to have for years! Thank you! Recently I posted about donations and @bernhard's paypal link was on the list. But to my regret I have not donated to him myself. I wish I could fix my mistake, but things happened since then that do not allow me to pay online abroad anymore ? Please be so kind to help me out here and start donating to Bernhard. I know he will appreciate it. And I will join you as soon as I find a way to. 7 Link to comment Share on other sites More sharing options...
bernhard Posted March 12, 2022 Share Posted March 12, 2022 Thx Ryan for pulling my changes and improving them ? I wonder if you have any numbers of how much more efficient it is to use a non-hookable method compared to using a hookable method? I'm usually not thinking too much about this as everything seems to be fast anyhow. But as you have refactored that approach it might be a noticable difference? I'd be very happy about some insights ? 2 Link to comment Share on other sites More sharing options...
cpx3 Posted March 14, 2022 Share Posted March 14, 2022 After installing the update unfortunately the site does not load anymore. Neither the frontend nor the backend seems to be accessible anymore, everything freezes while loading... Link to comment Share on other sites More sharing options...
netcarver Posted March 15, 2022 Share Posted March 15, 2022 @cpx3 Were you able to revert to the previous installed version to restore your site's operation? Also, if you look in site/assets/logs for the latest entries in the error.txt and exceptions.txt files, you may get a better picture of what's going on - and if you are running PHP with error logging turned on you can look in the PHP logs too. The exact location of these files (and if they are even used) will depend on your php.ini file. 1 Link to comment Share on other sites More sharing options...
ryan Posted March 15, 2022 Author Share Posted March 15, 2022 Quote Thx Ryan for pulling my changes and improving them ? I wonder if you have any numbers of how much more efficient it is to use a non-hookable method compared to using a hookable method? I'm usually not thinking too much about this as everything seems to be fast anyhow. But as you have refactored that approach it might be a noticable difference? I'd be very happy about some insights @bernhard I don't have numbers, but it would be interesting to benchmark sometime. I do know that I've tried to optimize the hook calls as much as possible, so I expect they should be fast. I would guess that you'd have to get the combined effect of many calls before you start seeing the difference. But it does still take significant code to make hooks happen, as the method call has to pass through a PHP __call() which then checks of there are any hook methods available to call, then it triggers any found before hook methods, calls the the original hooked method, gets the return value, then triggers any found after hooks, gets the return value again, then returns control to the original __call(), which then provides the return value to the caller. It's the minimum needed, but it's still a lot of steps. In the case of the admin theme, all the parts of it get added via include() calls to the different layout files, and that's very fast. I wanted to keep that benefit for cases where people didn't need to override anything or, didn't have hooks. That way it's still just a simple fast include(), except when you wanted to hook into it or use customize different files. It may not be something you can feel in any one request, but it would be something you could measure the combined effect of over several requests. I figure it's my responsibility to make sure PW uses as little CPU (translating to as little energy) as possible for anything it does, at least the things where I know how to. Something like the admin theme gets used by everyone that uses PW, and so little things can add up to big things when spread out over the scale of all installations. But how much difference it makes, I don't know for certain. So part if it is also about having fun and trying to be useful. Quote After installing the update unfortunately the site does not load anymore. Neither the frontend nor the backend seems to be accessible anymore, everything freezes while loading... @cpx3 What version did you upgrade from? Enable debug mode ($config->debug=true; in /site/config.php) and also check the log files that netcarver mentioned above. That should hopefully point to whatever the issue might be in this case. Please let us know. 1 Link to comment Share on other sites More sharing options...
cpx3 Posted March 15, 2022 Share Posted March 15, 2022 Thanks for the support! I tried everything, including a complete new installation, but the update seemed to be a coincidence. Actually the error message I found in the logs was the following: "Error: Exception: Unable to obtain lock for session (retry in 30s)"... When not using any sessions it seems to work. Link to comment Share on other sites More sharing options...
zoeck Posted March 15, 2022 Share Posted March 15, 2022 4 minutes ago, cpx3 said: Thanks for the support! I tried everything, including a complete new installation, but the update seemed to be a coincidence. Actually the error message I found in the logs was the following: "Error: Exception: Unable to obtain lock for session (retry in 30s)"... When not using any sessions it seems to work. Do you have an older version of Tracy Debugger installed? If yes, try to switch off Tracy or update Tracy to the latest version (4.23.25). 2 Link to comment Share on other sites More sharing options...
cpx3 Posted March 15, 2022 Share Posted March 15, 2022 Yes, I did! Thanks for the hint, I will immediately update it! 1 Link to comment Share on other sites More sharing options...
cpx3 Posted March 15, 2022 Share Posted March 15, 2022 I did the update, now I cannot even login to PW anymore as the admin is not loading... (I restarted the whole server but it does not help at all). Any other ideas? Link to comment Share on other sites More sharing options...
zoeck Posted March 15, 2022 Share Posted March 15, 2022 4 minutes ago, cpx3 said: I did the update, now I cannot even login to PW anymore as the admin is not loading... (I restarted the whole server but it does not help at all). Any other ideas? Sounds like something went wrong with the update. Just Rename the "TracyDebugger" Folder in "\site\modules" to ".TracyDebugger" After that try again if you get back into the admin panel Link to comment Share on other sites More sharing options...
cpx3 Posted March 15, 2022 Share Posted March 15, 2022 There seems to be a problem with the sessions. I always find the error message: Error: Exception: Unable to obtain lock for session (retry in 30s) in my log and the page seems to be delayed. I commented out all the sessions but it does not become better. Maybe there is no relation between that and the update but the problems occured immediately after updating PW. Link to comment Share on other sites More sharing options...
adrian Posted March 15, 2022 Share Posted March 15, 2022 Have you looked at: https://processwire.com/talk/topic/26070-error-exception-unable-to-obtain-lock-for-session/ ? I didn't actually know about this Tracy issue. I think perhaps it's a combo between it and the SessionHandlerDB module. Tracy does now use a different approach to sessions (by default), but I'd still try disabling the SessionHandlerDB module. 1 Link to comment Share on other sites More sharing options...
zoeck Posted March 15, 2022 Share Posted March 15, 2022 30 minutes ago, adrian said: Have you looked at: https://processwire.com/talk/topic/26070-error-exception-unable-to-obtain-lock-for-session/ ? I didn't actually know about this Tracy issue. I think perhaps it's a combo between it and the SessionHandlerDB module. Tracy does now use a different approach to sessions (by default), but I'd still try disabling the SessionHandlerDB module. That's where I got my info, but I missed that it's related to the SessionHandlerDB module ? Link to comment Share on other sites More sharing options...
ryan Posted March 15, 2022 Author Share Posted March 15, 2022 @cpx3 It sounds like the session is locked in the database. Try again from an incognito window or another browser. Or if you are running localhost like on WAMP/MAMP or something, you might try to reboot the database, which should also clear it. Link to comment Share on other sites More sharing options...
cpx3 Posted March 15, 2022 Share Posted March 15, 2022 Adrian, thanks for your reply. I actually disabled both of them (by uninstalling the SessionHandlerDB module). It became slightly better but now another problem appeared: The selector "select_regions.name!=schweiz,select_regions.name!=liechtenstein, template=template-news, start=1, limit=1, sort=-id". Any idea what might be wrong? Link to comment Share on other sites More sharing options...
cpx3 Posted March 15, 2022 Share Posted March 15, 2022 15 minutes ago, ryan said: @cpx3 It sounds like the session is locked in the database. Try again from an incognito window or another browser. Or if you are running localhost like on WAMP/MAMP or something, you might try to reboot the database, which should also clear it. Thanks for the incredible support here! 1 Link to comment Share on other sites More sharing options...
gornycreative Posted March 19, 2022 Share Posted March 19, 2022 On 3/11/2022 at 1:49 PM, ryan said: You can also find all of the render files in the core AdminThemeUikit directory — any .php files beginning with an underscore are custom render files that can be overridden. How can I turn off these notices? Even when debug mode is disabled, they appear for any custom render files replaced every time the page is loaded. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now