ezsystems/ezpublish-kernel — pull request #893 by pspanja (2014-06-17 11:50:08+00:00)
Title: Fix EZP-23025: Page field type Block can't be rendered using ESI strategy

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

`PageController::viewBlock()` accepts Block object as first argument, which does not work when using real reverse proxy (Varnish). In order not to introduce BC break, this implements a new controller action `viewBlockById()` which accepts Block id instead of Block object and therefore is usable with ESI strategy in all contexts.

The fix required adding `PageService::getBlockById()` method, which loads the Block in a bit roundabout way. Reason for this is that complete Block data can't be loaded from `ezm_block` table alone, instead it needs to be loaded from the XML stored in the field value. This is then done by iterating through fields of the Content of the Location pointed to by `ezm_block.node_id`.

Tests: unit tests and manual tests with Varnish.