Back-office

This project is not covered by Drupal’s security advisory policy.

File_history are a form api element (and a file field wigdet in the 2.x branch)

Ok... what else ?

The main feature of file history are permitting to maintain a "memory" or a collection of "non-used" files and provide an easy switch between them.

A use case ?

The main use case of this field are providing data from processing files. A contributor want to expose an amount of data so huge that the "manual contribution" are not a workable solution.
But, such an amount of data, make the upload and replacement of file for processing a little risky.
File_history permit, by the upload validations from file module, a validation of the new file during upload. After upload, and save of form/entity, the new file is only "load" but not activ. The new file become active only after selection. If after all, data aren't corrects, the old file remain on the field. A simple click on "select/unselect" buttons permit the rollback.

Branches

1.x : The legacy One

The form element propose more customisations than the widget.
The "no_upload", "no_use", "no_download" items in one hand and "create_missing" items in the other hand permit you to create a list of non-drupal generated files (like logs of operations). You can manage donwload, delete there files, maintaining a little history of the operations

2.x : CCK compatibility

- A file field widget based on the form API element
- A "test module" (test_file_history) are present with a preconfigured node type and a test form ( /admin/file_history/exemple_form ).
- The cleaning of the "managing file directly in folder" mecanics, now totaly based on core - file API

3.x : Drupal 10 ready

That is the 2.x branch port to Drupal 10.
Why a new branch ? because some of Drupal service has changed...

More ?

Documentation ?

Read more in the full documentation

1.x to 2.x/3.x migration

The module ensures backwards compatibility.
For this, it is necessary to add an attribute '#legacy' => TRUE, on the "file_history" form element.

 $form['configurations_files'] = [
      '#type' => 'file_history',
       [...]
      '#legacy' => TRUE,
      '#create_missing' => TRUE,
Supporting organizations: 

Project information

Releases