Solution: Disabling versioning for content objects

Problem

The problem is versioning is built in (deep) into eZ publish. You can’t just remove it. Thankfully it is fairly configurable so you can extended the base implementation and alter key areas to archive the desired results. Which are more of a way to minimize revisions / hide the revision management.

There are a few issues involved in achieving these results.

  • admin edit views
  • user edit views
  • add: edit view template (override) to remove / hide all non-essential functionality
  • alter: (optional) a content class version history limit from 5 to 2.
  • add: use hidden form fields to specify values of attributes

Misc References

  • [20:20] <zrg> i think returnURI field is relevant to mention there
  • [20:20] <kracker> agreed, i’m working through finding the correct acl permissions configuration for the web app
  • [20:21] <zrg> also the disableconfirm, i have yet to find out tho exactly how they can be used
  • [20:24] <zrg> its gonna be good. but now i sleep, will add the gory details when back among living
  • [20:25] * zrg is now known as zrg_comatose

Solution #1

Restrict Class Version History (by class) to only two revisions, published or draft.

  1. Edit the your override for content.ini (ie: override/content.ini.append.php )
    1. For folder class in content.ini
    2. See: VersionHistoryClass[1]=5
    3. Change it to : VersionHistoryClass[1]=2
    4. Warning: If you change it to 1 (ie: VersionHistoryClass[1]=1 ) you will not be able to edit object
  2. How to use hidden form fields to specify values of attributes
  3. Remove the discard draft warning (non-core)

Solution #2

We found this kind of hack (for 3.4.2) to turn of the draft versioning mechanism: just override the content/edit_draft.tpl with this:

{let
  last_draft=$object.versions|extract_right(1)[0]
  content_attributes=$last_draft.contentobject_attributes
  main_node_id=$last_draft.main_parent_node_id
  edit_version=$last_draft.version
  edit_language=$last_draft.translation.language_code
  attribute_base='ContentObjectAttribute'
 }
  
 {include uri="design:content/edit.tpl"}
  
 {/let}

References