The content of some Drupal 7 blocks are returned as render arrays. Other D7 sites can render those, but D6 sites cannot.

In the D7 version, add another argument to the sharedblocks/%/% menu callback to specify the format. In sharedblocks_fetch_block(), tack array at the end of the URL.

In sharedblocks_publish_block(), check this new argument. If it's 'array' (as it will be when D7 sites are requesting the block), encode the $block array as-is; otherwise, assume that the requesting site cannot handle render arrays, and render $block['content'] if it is an array, before encoding it.

Comments

Dave Reid’s picture

I have a feeling that we probably just need to standardize what gets sent and returned, rather than handle multiple formats. I propose the following, always 'sending' a simple array with 'subject' with the block title on the providing site, and 'content' which is just HTML, and not render array.

Dave Reid’s picture

Issue summary: View changes
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.