Today I was trying to make a change in the login form. After wondering for a while why my changes aren’t applied, I found out that the most recent versions of Magento include a new Mage module called Persistent. This module overrides the normal customer/form/login.phtml, customer/form/register.phtml and checkout/onepage/login.phtml. To get your changes to actually work you need to change the new templates in the template/persistent folder.
The most annoying thing I encounter when occasionnaly working on a Mac is the mouse acceleration. I found a command line that will disable it but you need to relog after executing it:
defaults write -g com.apple.mouse.scaling -1
Note: Don’t touch the mouse settings in Preferences or it will override the above change.
Even tough PHP 5.3 has been out for quite a while, there is still lots of old code out there that will not run correctly when moved from 5.2 to 5.3. In my case I had to move a 2 year old Magento website to a new server and ran into problems as the default version of PHP on the new server was setup as PHP 5.3. Altough PHP 5.3 is a “minor” version, there is quite a few “deprecated” core functions and severak little things that just dont work the same anymore. So in this post I will explain specifically what functions I had to update and a couple of examples of how I did it in each case.
I recently installed the lastest version of Mantis Bug Tracker. Sadly when I tried to signup for the first time, the captcha used in the signup form didn’t show up. Opening the generated jpeg file reveals several errors related to my server’s PHP security settings.
SYSTEM WARNING: ‘file_exists(): open_basedir restriction in effect. File(/usr/share/fonts/corefonts/) is not within the allowed path(s)
mantis/core/utility_api.phpin utility_api.php’ line 253
mantis/core/utility_api.phputility_api.php’ line 255
mantis/core/utility_api.php line 257
mantis/make_captcha_img.php line 124
To fix the problem I added a fonts folder within my Mantis installation root, added the ARIAL.TTF font file inside that folder and then added a $g_system_font_folder variable to the mantis configuration file config_inc.php to point to the fonts folder.
Step by step guide
Today I got this mysterious error message after moving a Magento website to a new server.
Magento Notice: Undefined index: 0 in .../htdocs/app/code/core/Mage/Core/Model/Mysql4/Config.php on line 92
Turns out this was due to a faulty import of the database. Apparently there are a few tables where using an id of 0 in the auto_increment column has a particular meaning and is intended. When restoring the MySQL dump through Navicat it replaced id values of 0 in auto_increment columns with new auto-incremented ids instead of 0 which broke Magento.
To fix this I simply dropped the whole database and reimported the dump using the official MySQL command line client (mysql -u username -p db_name < scrip.sql) and everything worked fine.