Over the last couple of days, I've had a bizarre problem where Magento (1.x series, 1.9.1.0 specifically) would crash halfway through rendering a page, and refuse point blank to display the error anywhere or log it. Much hair pulling later, checking of nginx configs, making sure developer mode was enabled, forcibly ensuring all errors were shown, and then eventually manually stepping through every step of the code, I discovered a core hack. This in itself isn't that unusual when dealing with customer systems developed by other people, and I'd moved it to its own local folder as part of cleanup, but the code in question was doing a @dba_open (that's a Berkeley DB file opener), with the @ sign to prevent errors being shown. (The actual problem was I didn't have BDB support enabled on PHP, but as all errors were being suppressed, it was a tad difficult to track down.)
That in itself makes sense, but what I also learned what that @ before the function actually does is internally run error_handling(0) - then when it actually bailed, it ran the Magento custom error handler mageCoreErrorHandler in app/code/core/Mage/Core/functions.php, which would normally log an exception and/or display it on screen - except for the fact the @ had set the error_handling to 0 which was then run through $errno = $errno & error_reporting() , which immediately returned false if the AND returned 0, and promptly crashed mid-render without any explanation as to why, as the error handler decided it wasn't actually an error worth reporting.
I've also no idea why someone would pull out data from a berkeley flat DB in the middle of a Magento page render, it's a bit messy, but my guess is the developer was on the wrong end of the cheap/fast/good triangle.
Short version - don't use @ in the middle of Magento code - or indeed any code - without writing some proper error handling / logging of your own, because if someone else has to come and deal with it later, they're likely to end up banging their heads against a brick wall. Especially if it's hidden in the deep, dark depths of a core hack.
21 November 2017
24 May 2017
Wileyfox Android Nougat 7 upgrade and lost contacts
Came across a problem with a family member who'd upgraded their Wileyfox Swift to Android 7.x, guessing it's their new version without Cyanogen on the sticker, but had lost all his contacts in the first place. Seems the original OS had the ability to add a Hotmail account and sync all the contacts to it using the built-in mail app, and the new one only had the ability to read it over IMAP. The confusion mainly arose because the hotmail account was also his Google account, and Android was trying (and obviously failing) to sync Gmail.
The solution is to remove the IMAP account from gmail/whatever mail client they have, and install Outlook from the play store, and go into settings and set it to sync contacts. Instant relief.
Hope this helps someone.
The solution is to remove the IMAP account from gmail/whatever mail client they have, and install Outlook from the play store, and go into settings and set it to sync contacts. Instant relief.
Hope this helps someone.
02 January 2017
Lenovo Thinkpad E545 (and E445?) BIOS bug for AMD-V virtualization
Short version: Disabling the AMD-V virtualization support in the BIOS (AMD equivalent of VT-X) actually enables it, and enabling it disables it. Way to go, Lenovo. (May not affect newer BIOS versions, I'm running HRET24WW (version 1.12), but haven't upgraded as this BIOS is patched to remove the wifi whitelist (another pointless annoyance IMO, should be an option to allow "unauthorised" cards!).
Lost 4 hours yesterday trying to figure out the answer to this one. Hopefully this saves someone else that time!
Lost 4 hours yesterday trying to figure out the answer to this one. Hopefully this saves someone else that time!
Subscribe to:
Posts (Atom)