ezsystems/ezpublish — pull request #364 by dpobel (2012-07-06 13:09:57+00:00)
Title: Fixed #19169: duplicated object state groups after changing default language

Bug: http://issues.ez.no/19169

Description
===========
After changing the default language of an existing content object state group, the content object state group is listed twice in /state/groups. This is because the content object state group language objects are not correctly stored. This happens because the primary key of the content object state group language is composed of the content object state group id and the language id, but the language id might be affected by the always available flag used to mark the default language. In short terms, the primary key is not so primary :-)

This patch adds a real_language_id column to store the language_id without the always available flag and changes the primary key to use this new field. There's also a script to remove the duplicated entries.

A pull request for the SQL upgrade script in Oracle will follow.

Testing
=======
Manual tests with PostgreSQL and MySQL (manipulating content object state group through the GUI + using the upgrade scripts with affected and not affected groups).