1 Configuration
The feature has to be activated generally in the configuration:
$FEATURE["wastebin"] = true;
2 Archive Workflows
If any archiving workflows (workflows that will move objects instead of deleting them) have been defined and activated, they must be deactivated or removed in order to properly use the wastebin.
3 Functionality
If a user deletes an object (folder, page, image or file) in a node, that has the Wastebin activated, the object will not be deleted permanently, but put into the Wastebin instead.
This will be done in a transparent fashion, so the user deleting the object will see no difference, whether the Wastebin is activated for the node or not.
The feature multichannelling allows creation of localized copies of objects in channels. If an object from the master is put into the wastebin, all its localized copies will also be put into the wastebin.
4 The Wastebin
Users with sufficient privileges can inspect the Wastebin for a node and can remove objects from the Wastebin (which will permanently delete them) or restore objects from the Wastebin.
4.1 Permissions
Users need to have the permission to Show and restore the Wastebin for the node to inspect the Wastebin and perform actions on deleted objects. Additionally, the general view privileges on the objects are also required to see and act upon objects in the Wastebin.
4.2 Inspect the Wastebin
Users with sufficient privileges will have access to the Wastebin through an additional entry in the tree.
Clicking on the Wastebin entry will show the Wastebin view in the main frame.
The Wastebin view will show deleted objects of the selected type. Like for normal object lists, the type can be switched by clicking the icons in the assistant frame.
4.3 Show deleted objects
Additionally, it is possible to show deleted objects in the normal object lists and the folder tree. Showing the deleted objects can be toggled with the action Show deleted/Hide deleted in the related links.
The deleted objects will be shown together with all other objects, but will be specially marked.
When deleted objects are shown, not all actions are available in the object list, since deleted objects cannot be edited.
4.4 Removing objects
Objects in the Wastebin can be removed permanently. The action Remove from Wastebin is available either in the Wastebin view or for deleted objects in the normal object list view.
When a folder is permanently removed from the Wastebin, this will also affect all objects (folders, pages, images and files) that are contained in this folder and were also put into the Wastebin.
For pages in the Wastebin, there is an action Remove from Wastebin (all languages) which will remove all language variants of the page, that were put into the Wastebin before. Language variants, that were not put into the Wastebin will not be affected.
4.5 Implicit removal
There are some situations, where objects will be implicitly removed from the Wastebin.
4.5.1 Language variants
There can only be one variant of a page in a specific language. That means that if e.g. the german variant of a page is deleted and put into the wastebin, and the page is then translated into german again, the deleted german variant is implicitly removed from the wastebin.
4.5.2 Localized copies
Every object may only have up to one localized copy in a specific channel. So when this localized copy is deleted and put into the wastebin, and after that the object is localized in the channel again, the deleted localized copy is implicitly removed from the wastebin.
Furthermore when both the localized copy and the master object are in the wastebin, removing the master object will also remove all localized copies.
4.6 Restoring objects
Objects in the Wastebin can be restored. The action Restore is available either in the Wastebin view or for deleted objects in the normal object list view.
The objects will be restored in the same folder, in which they were deleted.
When multichannelling is used a localized copy of an object can only be restored if the master object is not also in the wastebin, or the user has the necessary privileges to implicitly restore it. Also note that restoring a master object, will not automatically restore its localized copies.
If an object is restored from the Wastebin, its folder will also be restored, if necessary.
4.7 Disinheriting and the wastebin
Localized or local objects that were put into the wastebin of a channel will prevent their mother folders from being disinherited. The message shown to the user in such cases will state that the obstructing object is in the wastebin.
5 Reimporting deleted objects
If objects were deleted and put into the Wastebin, and are then re-created through an import, the object from the Wastebin will be restored and overwritten by the import.
6 Purging the Wastebin
The wastebin can be purged using a scheduler task. Objects will be removed by this task from the wastebin, if
- They reach a maximum age in the wastebin
- The wastebin feature was switched off again
6.1 Maximum age configuration
It is possible to configure a maximum age for all objects:
$WASTEBIN_MAXAGE = 7*24*60*60; // maximum age: 7 days (in seconds)
Additionally, it is possible to overwrite the global configuration for specific nodes:
$WASTEBIN_MAXAGE_NODE[1] = 60; // objects in node with ID 1 last only 60 seconds
By default, neither the global, nor any individual settings are configured, so running the purge task will just do nothing (unless the feature was switched off again).
6.2 Scheduler task
For purging the Wastebin, it is necessary to create a schedule with the internal purgewastebin
task.