5

Somebody claimed that content has disappeared from their site. Of course like magically. No one has deleted it, they said.

How can I find out if content was deleted and by whom? Do I have to set up rules to notify me? Or is there a log that I'm overlooking? I already looked into admin/reports/dblog without success.

4 Answers 4

7

Check out their http://example.com/admin/reports/dblog. You should have messages like this one:

Type        content
Date        Wednesday, June 5, 2013 - 09:11
User        admin
Location    http://localhost/node/1/delete
Referrer    http://localhost/node/1/delete
Message     page: deleted test.

For future, you can use hook_watchdog()

This hook allows modules to route log events to custom destinations, such as SMS, Email, pager, syslog, ...etc.

0
3

You can probably use https://drupal.org/documentation/modules/notify. I have not used it but it seems that it might do what want. If you can use code you could also consider implementing

hook_node_delete();

Described here. This is invoked on every node deletion.

As for the logs, I don't have any hint.

1

Here is another approach that might help to address the "is there a log that I'm overlooking" in the question ...

Start from a "Crosstab table" containing statistics (summary info) of the Watchdog Statistics, as in this sample:

enter image description here

This sample does not actually include any info about "deleted content" (because no such records were found in the specific situation). But it should be clear that you get 1 row for each flavour of Watchdog entries. Note those red numbers to the right of the table, which are actually hyperlinks that can be used as drill-down reports. I.e. if you click on any of them (like the "2" for "Page not found"), you get a details report about (in this case) the 2 specific records related to the "Page not found").

How did I create such drill-down report? Rather straight forward ... I created a custom report using module Forena. More details about this specific case can be found in comment #2 of issue 2337327. Obvious, I didn't really do any effort to beef up the look-and-feel of that report, like background, etc. I'd be happy to share the "source code" of that custom report, e.g. by adding it as an attachment to the same issue. Note that at the time that comment was added, it was rather a work-in-progress version of that report. And in the meantime forena has evolved to make such crosstab tables easier to develop. Today it even allows for charting with drill down links.

Be aware: I'm a co-maintainer of forena.

1

The Entity Delete Log module handles this by permanently tracking the following information when an entity is deleted:

Entity ID
Entity Type
Entity Bundle
Entity Author
Entity Title
Number of Revisions
Created Date
Deleted Date
User Who Deleted Entity

It works for core entity types in Drupal:

Comments
Files
Nodes
Taxonomy Terms
Taxonomy Vocabularies
Users

It has built in support for Views, so it's easy to build custom reports.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.