When using the revisioning module and cck blocks together, it can happen that a field value from the wrong node revision is displayed.

Setup:

  • I'm logged in as a user that has all neccessary rights to create revisions
  • Revisioning configuration: Links to view content default to: displaying the latest revision
  • have configured a node type (e.g. article) to be used with revisioning. This node type has a cck field configured to be shown as a block (mine is called contact)

Steps to reproduce:

  • create a new article, assign a first value to your cck field and save
  • edit the new article, modify the cck field and therefore create a new and pending revision. Note that the new revision is visible to the authorized user but not to the public
  • view the new revision: using the path node/NID you'll notice that the CCK field and your node content are out of sync
  • viewing the new revision explicitely (path node/NID/revisions/VID/view, you'll see node content and the cck field correctly

Digging in the code, I found that cck_blocks calls $node = menu_get_object(); to determine the current node. This doesn't reliably determine the correct VID as revisioning does also show revisions which are not published yet.

I'd be glad if someone could give feedback on the patch, I'll provide.

Comments

organicwire’s picture

Here's a patch which solved this issue for me.

organicwire’s picture

Status: Active » Needs review
organicwire’s picture

I just wondered if someone could review my fix. Is there any info i can provide to support a review?