Hello,

I have created a patch for nodeblock which, in personal tests, I have found quite useful. The patch adds transparent support for using UUID block deltas in nodeblocks (see: the UUID project).

Why?

  • Managing nodeblocks with Features is a lot easier when using UUIDs (because the Node Export project's Features support uses UUIDs to manage the nodes)
  • Working with nodeblock references in exported Panels becomes worlds easier, now if your nodeblocks change NID (eg: because you rebuilt your site from install profile, or you enabled / disabled some Features) your Panels pages won't break

What does it cost me?

  • There is a small catch .. the standard {block} table only allows a delta of 32 characters. To enable UUID support this limit must be raised with a schema change, which is a bit ugly unfortunately. But it is transparent and, from my testing, doesn't cause any issues. Though it would be nice for a core maintainer to verify this.

How do I use it?

  • Apply the patch
  • Set the nodeblock_uuid variable to "1" (eg: using drush). A GUI to control the setting will come shortly..
  • Your nodeblocks will transparently start using UUIDs, existing references to NID based deltas will continue to work too.

Comments

James Andres’s picture

StatusFileSize
new4.33 KB

And, here's the patch.

James Andres’s picture

Oh I should also mention, this patch doesn't add a dependency on the UUID project. The UUID support only becomes enabled if the 'uuid_node' module is found to exist.

James Andres’s picture

StatusFileSize
new4.25 KB

Here is an updated patch that is a bit simpler.

Updates:

  • Removed the requirement for the 'nodeblock_uuid' variable to be set for UUID functionality to work. This removes the need for a GUI which is simpler. The rationale for this is: if the UUID module exists why not provide a better experience and just use it?
michaellander’s picture

Hey James, let me look into this a bit and decide what I want to do. I'm gonna be making some larger changes to this module soon and may decide to start a 7.x-2.x branch. I want to also add support for the multiblock module to allow duplicating node blocks(with seperate view_modes). I'd also like the move the settings into it's own table instead of in variables. I'm undecided right now if I'm going to do that in the current branch or the new one. I'll be making a road map thread soon to get user feedback. I've got to decide where your stuff all fits into that as well. I'd certainly would like to support improving drupal's ability to handle exportables however I can.

James Andres’s picture

StatusFileSize
new4.7 KB

Hi mikegfx, sounds good.

Until then, here is an updated patch that works with the new UUID module that uses entities.

Johnny vd Laar’s picture

Status: Needs review » Fixed

I have added a machine name field, this works separate of the UUID module.

It's added here:
http://drupalcode.org/project/nodeblock.git/commitdiff/23ab1cb?hp=9fd890...

Please reopen this one if you find a bug in this.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Updating ticket to reflect new patch.