Pierrick on Piwigo

Piwigo is the open source photo gallery for the web

Piwigo 2.1.1 avoids to break user registration

Hi Piwigo followers,

1 week ago, while I was visiting a Piwigo 2.1.0, the webmaster asked me to register to see the private photos. But when I registered, I received many errors and Piwigo was simply telling me that I had to sign in, whatever the page I wanted to see (even the photo gallery homepage), which is not the expected behavior with Piwigo. I had to remove the authentication cookie to be able to browse the gallery as guest. Very annoying. Very disturbing also, because I had not encountered this bug during 2.1 beta-testing. I thought that this Piwigo installation had customed code, responsible of the bug. I was wrong.

Just 2 days after, Leo encountered the same issue. Conclusion: the bug is in Piwigo standard code, not in any specific modification. Not only did Leo encountered the issue, but he also realized that after a fresh install, it was impossible to reproduce the bug. Even better, Leo investigated and found the way to reproduce the problem: as soon as you edit the guest settings (Administration > Configuration > Options > Guest Settings), then user registration is broken. It is very hard to find the way to reproduce a bug when the consequence is visible far away (registration) from the origin (guest settings administration).

Once the investigation done, the most complex part of bug squashing was over. The problem was that submitting new guest settings was deleting default theme and default language. When a new user registers, Piwigo sets it theme with the current default theme and BANG! Null is not a valid default theme. So we had 2 problems to solve:

1) fixing the origin of the bug (avoid deletion of default theme and default language), this one was easy

2) taking into account that probably many 2.1.0 now had the bug (null as default theme). Considering that the upgrade from 2.1.0 to 2.1.1 could not easily include database upgrade, I decided to include an automatic repair piece of code: if the current default theme is null, then we update it (at database level) with the hard coded default theme. That is to say “Sylvia”. This piece of code will be removed from Piwigo 2.2, because we will have added a clean database upgrade task.

This was the story of Piwigo 2.1.1 creation, created in a hurry. Oh and Piwigo 2.1.1 also fixes a bug on EXIF computed fieds and a display bug on Internet Explorer 8. Read Piwigo 2.1.1 release notes.

Thank you Leo 🙂


Written by plg

May 29, 2010 at 9:09 pm

Posted in Miscellaneous

%d bloggers like this: