ezsystems/ezpublish — pull request #394 by dpobel (2012-08-10 08:21:54+00:00)
Title: Fixed #019549: Incorrect language masks set for URL alias

Bug: http://issues.ez.no/19549
Based on the pull request: https://github.com/ezsystems/ezpublish/pull/383

Description
===========
In a siteaccess that is only able to display contents in a language A, the URL alias of a content might be wrongly generated if the parent is not translated in A:

* if the parent is _always available_, the URL part corresponding to it is randomly picked in the available translations (actually the first one in DB result set is used)
* if the parent is not _always available_, the URL generation fails and the system URL is used.

To fix this issue, this patch changes the way the `lang_mask` column is handled in `ezurlalias_ml`. It will now behave like `ezcontentobject_name.language_id` where the bit 0 is used to mark the main language, no matter if the content object is _always available_ or not. This allows to take the main language entry while generating the URL if no other language matches.

Testing
=======
Manual tests + unit tests

Note: after the review of the patch, I'll ask the QA team to test it before I commit and push it.