Node Version

Categories

Component ID

2498705

Component name

Node Version

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

This module supports the following use case:

Use case

A drupal 7 website with content that has a periodic updates (e.g. yearly). Every update is called a version of that content.
The website visitor has default access to the latest published version, but can also browse to a previous version for that content.

History

This module has its origin in a (non-generic) custom module for a website that publishes updated content twice a year. The website contains a information reference model for a dutch healthcare information system for general practitioners. This sandbox project aims to make this module generic.
The code of this module is based on the code of the module Custom Publishing options but with major adjustments. That module showed how to tackle many obstacles.

Approach

The module Custom Publishing options adds columns tot the node table. One for each added custom publishing option.
The Node Version module does the same, except that the column contains a reference to a specific revision of that node (the vid value of the revision), instead of a boolean. There is an admin page that provides the possibility to add, remove and alter Node Version types. Every node version type has its own column in the node table.
In Views there provides handlers for relationships:
- Node Version: Node Revision to Node
- Node Revision: Node to Node Revision data
With a hook, the Views query alters these relationships based on specific conditions (with should be changed in a generic solution): The query is altered so that the 'vid' column in the handlers is replaced with one of the node version columns. e.g.:

WHERE {node revision}.vid = {node}.vid
becomes
WHERE {node revision}.vid = {node}.nodeversioncolumn

Other dependencies

  • views bulk operations, the node.vid values of selected content will be copied to a chosen node.nodeversion columns.
  • revisioning module

Pledge

The website that required this module is operational, there is no commercial interest from the author. If people are interested I will share the code and develop it into a generic, and more sound solution. Since I am not a seisoned programmer, I will need the help of a co-maintainer and/or contributors to make this module successful. Please send me a message if you are confronted with a similar use case and/or weather you would like to contribute/co-maintain to this module.

I will upload the module when there is sufficient interest.