ezsystems/ezpublish-kernel — pull request #785 by pspanja (2014-03-25 15:45:18+00:00)
Title: Fix ezp 22471 draft content location

This PR resolves https://jira.ez.no/browse/EZP-22471

When loading Content or VersionInfo, LEFT JOIN with `ezcontentobject_tree` table is always done with its `contentobject_version` column in join conditions. This table contains Location data for published Content only, so when resource is loaded for non-published version join will always fail, causing its data to be `null`. In this case it means `ContentInfo::mainLocationId` will be null.

That is wrong, as it is not possible to load ContentInfo for a specific version, it always relates to the current Content and should not be affected if it is contained in Content or VersionInfo loaded for draft or archived version.

This fixes the problem by removing `contentobject_version` from join conditions.
It also fixes gateway unit test for loading Content data and adds missing unit test for loading VersionInfo data.
Related integration tests are changed to proper context for checking `ContentInfo::mainLocationId`.