Although we are still in beta version, as we said over and over again, there are people who have installed Siwapp on their own server. If you’re one of those people, intrepid adventurer, and you have decided to try luck with the latest version of PHP (5.3), you can suddenly get a 500 error when trying to access the application.
It is not my intention to enter into boring technical details, but think it is necessary a brief explanation. When you log into the application, it performs some checks for recurring invoices. These verifications are associated with other checks in the customers table that should have no effect in normal conditions.
Each customer is associated with an internal name that is generated from its own name. The programming associated with that task has not changed, but behaves differently in PHP5.2 and PHP 5.3: before accented vowels were removed, now they are replaced by non-accented vowels. Therefore, a customer whose name is “Fundación ABC” (“ABC Foundation”), in PHP 5.2 had an internal name such as “fundacinabc” but in PHP 5.3, the generated internal name is “fundacionabc”. As the internal name is used to decide if we create a new customer object, it is possible that a customer created in the old environment appear as nonexistent in the new environment, and the application will try to create it again as a new customer, producing the error.
Well, at the end it has not been such a short explanation.
If your customers do not have names with accented vowels or non US characters you probably will have no problem. If you get that error you can do one of these things:
- If you installed from a package downloaded from the web or you installed through subversion and you are in a tag (RELEASE_0_3_…), apply this patch.
- If you use subversion and you are in /trunk just update.
- Wait to 0.4 version.
In UNIX system you can apply the patch (assuming you copied and uncompressed it to the root of your install) doing:
cd /path/to/siwapp patch -p0 -i rebuildSlugsTask.diff
It will patch a file and create another one.
Execute the task
The patch added a task that must be executed in command line:
php symfony siwapp:rebuild-slugs
It will rebuild the internal names for all your customers and report the number of customers modified.