You are here

README.txt in Audit Files 7.4

CONTENTS
--------
 * Introduction
 * Reports
 * Buttons on Reports
 * Limiting Features Explained
 * Troubleshooting
 * Maintainers


INTRODUCTION
------------
The Audit Files module allows for comparing and correcting files and file
references in the "files" directory, in the database, and in content. It is
designed to help keep the files on your server in sync with those used by your
Drupal site.

This module avoids using the Drupal API when dealing with the files and their
references, so that more or different problems are not created when attempting
to fix the existing ones.

The module does use the Drupal API (as much as possible) to reduce the load on
the server, including (but not necessarily limited to) paging the reports and
using the Batch API to perform the various operations.

Seven reports are included, and they can be accessed at Administer > Reports >
Audit Files (admin/reports/auditfiles).


REPORTS
-------
Not in database
---------------
This report lists the files that are on the server, but that are not in the
file_managed database table. These may be orphan files whose parent node has
been deleted, they may be the result of a module not tidying up after itself,
or they may be the result of uploading files outside of Drupal (e.g., via FTP).

From this report you can mark files for deletion. Be careful with the delete
feature - the deletion is permanent - be sure the file is no longer needed
before erasing it!

You can also add one or more files to the file_managed table from this report.

Not on server
-------------
This report lists the files that are in the file_managed database table but
do not exist on the server. These missing files may mean that nodes do not
display as expected, for example, images may not display or downloads may not be
available.

You can also delete any items listed in the report from the database.

Managed not used
----------------
The files listed in this report are in the file_managed database table but not
in the file_usage table. Usually, this is normal and acceptable. This report
exists for completeness, so you may verify what is here is correct.

Used not managed
----------------
The files listed in this report are in the file_usage database table but not in
the file_managed table. Files listed here have had their Drupal management
removed, but are still being listed as used somewhere and may have content
referencing them.

You should verify the file's existence on the server and in the objects it is
listed as being used in, and either delete the reference in this report, or add
it to the file_managed table (which is a manual process, due to the fact that
the necessary data is not available to this module).

Used not referenced
-------------------
The files listed here are in the file_usage database table, but the content that
has the file field no longer contains the file reference.

The report lists both the file URI, so you can verify it still is a valid file,
and the file's usages, so you can see where it was being used. Both of those can
be used in determining what needs to happen with the reference.

Referenced not used
-------------------
Listed here are the file references in file fields attached to entities which do
not have a corresponding listing in the file_usage table.

What is listed in this report is the data of references themselves.  This can be
used to determine what needs to happen with the reference.

References listed here can either be deleted from the database or added to the
file_usage table.

Merge file references
---------------------
This report lists all files listed in the file_managed, along with their usages,
grouped by file name. With it, you can merge duplicate file references into a
single one. This reduces records in the database and saves space on the file
system.


BUTTONS ON THE REPORTS
----------------------
There are anywhere from zero to seven buttons available on any of the file
comparison reports. Below is a description of when the buttons are displayed and
what they do.

At the tops of the reports, there might be one or more of the following buttons,
depending on how you have configured the module: Load first batch set, Load all
records, Load previous batch set, Load next batch set and Reset record
selection.

Load all records
----------------
If the "Maximum records" field is not zero, this button will be displayed on the
reports. When it is pressed, the report is re-run using Drupal's Batch API, and
will load all records for the report.

Load first batch set
--------------------
If the "Batch set size" field is not zero, this button will be displayed on the
reports. When this button is pressed, the first set of records is loaded, using
Drupal's Batch API, and displayed in the report.

Load next batch set
-------------------
If the "Batch set size" field is not zero, this button will be displayed on the
reports. When it is pressed, the next set of records is loaded, using Drupal's
Batch API, and displayed in the report. Much like paging at the bottom of the
report, this pages records sets through the available records.

Load previous batch set
-----------------------
If the "Batch set size" field is not zero, this button will be displayed on the
reports. When it is pressed, the previous set of records is loaded, using
Drupal's Batch API, and displayed in the report. Much like paging at the bottom
of the report, this pages records sets through the available records.

Reset record selection
----------------------
If the "Maximum records" field is not zero, this button will be displayed on the
reports. When it is pressed, the variables used for controlling which set of
records and any saved records will be reset and the first page of the report
will be loaded anew.

At the bottoms of the reports, there will be one or both of the following
buttons, depending on the report: Add selected... and Delete selected... (the
text on these buttons is different on the various reports).

Add selected...
---------------
When there are items selected (checks in the check boxes) on the report and this
button is pressed, the items selected will be added to whatever it is that is
specified in the text of the button (a confirmation page is shown first). i.e.:
if the text of the button is "Add selected items to the database", then the
items will be added to the database.

Delete selected...
------------------
When there are items selected (checks in the check boxes) on the report and this
button is pressed, the items selected will be deleted from whatever it is the
text specifies on the button (a confirmation page is shown first). i.e.: if the
text of the button is "Delete selected items from the file_usage table", then
the items will be delete from the file_usage database table.


LIMITING FEATURES EXPLAINED
---------------------------
There are two administrative configuration settings that help with limiting the
records displayed, for when a report times out or exceeds the available memory.
They are: "Maximum records" and "Batch size." They are both found in the "Report
options" fieldset.

There are four possible combinations of these settings, one of which is invalid:
 1) Both set to zero: With these settings, all records are loaded and displayed.
 2) "Maximum records" set to some positive integer grater than zero and "Batch
    size." set to zero: With this combination, only the number of records in
    "Maximum records" will be initially loaded and displayed. At the top of the
    report page, there will be a button labeled "Load all records," with which
    you can load all records using Drupal's Batch API. This combination is also
    useful if you have a sizable number of records that take a while to display,
    but don't time out or exceed the memory limit, as it will allow a quicker
    initial load.
 3) "Maximum records" set to zero and "Batch size" set to some positive integer
    grater than zero: This combination is invalid, because if "Maximum records"
    set to zero, it does not matter what "Batch size" set to, because the
    records will never be loaded via the Batch API.
 4) Both set to some positive integer grater than zero: Sometimes, setting
    "Maximum records" and batch loading all the records isn't enough, and a
    report may still time out or exhaust the available memory. If that is the
    case, entering a positive integer in this setting will limit the batch
    operation and provide a paging mechanism for accessing the other records.
    To test if this will be helpful or not, set it to a lower number. If the
    report loads, then set it to a higher number to access more records per
    batch load operation. Since it is still using the Batch API, this number can
    be rather high, in an attempt to access as many records as possible.

For all options above, paging can be enabled with the "Number of items per page"
setting.


TROUBLESHOOTING
---------------
You receive the following error messages:
 * Warning: Unknown: POST Content-Length of [some number] bytes exceeds the
   limit of [some number] bytes in Unknown on line 0
 * Warning: Cannot modify header information - headers already sent in Unknown
   on line 0
 * (And a number of "Notice: Undefined index:..." messages.)
Set the "Maximum records" and "Batch size" settings on the Audit Files
administrative settings configuration page (admin/config/system/auditfiles), and
then use the "Load all records" button on the report that is producing the
error. See the Limiting Features Explained section above for more information.

You receive the following error messages:
 * Fatal error: Maximum execution time of [some number] seconds exceeded in
   [path to report file] on line [line number]
Set the "Maximum records" and "Batch size" settings on the Audit Files
administrative settings configuration page (admin/config/system/auditfiles), and
then use the "Load all records" button on the report that is producing the
error. See the Limiting Features Explained section above for more information.


MAINTAINERS
-----------
Current maintainers:
 * Andrey Andreev (andyceo) - https://www.drupal.org/user/152512
 * Jason Flatt (oadaeh) - https://www.drupal.org/user/4649

Previous maintainers:
 * Stuart Greenfield (Stuart Greenfield) - https://www.drupal.org/user/54866

File

README.txt
View source
  1. CONTENTS
  2. --------
  3. * Introduction
  4. * Reports
  5. * Buttons on Reports
  6. * Limiting Features Explained
  7. * Troubleshooting
  8. * Maintainers
  9. INTRODUCTION
  10. ------------
  11. The Audit Files module allows for comparing and correcting files and file
  12. references in the "files" directory, in the database, and in content. It is
  13. designed to help keep the files on your server in sync with those used by your
  14. Drupal site.
  15. This module avoids using the Drupal API when dealing with the files and their
  16. references, so that more or different problems are not created when attempting
  17. to fix the existing ones.
  18. The module does use the Drupal API (as much as possible) to reduce the load on
  19. the server, including (but not necessarily limited to) paging the reports and
  20. using the Batch API to perform the various operations.
  21. Seven reports are included, and they can be accessed at Administer > Reports >
  22. Audit Files (admin/reports/auditfiles).
  23. REPORTS
  24. -------
  25. Not in database
  26. ---------------
  27. This report lists the files that are on the server, but that are not in the
  28. file_managed database table. These may be orphan files whose parent node has
  29. been deleted, they may be the result of a module not tidying up after itself,
  30. or they may be the result of uploading files outside of Drupal (e.g., via FTP).
  31. From this report you can mark files for deletion. Be careful with the delete
  32. feature - the deletion is permanent - be sure the file is no longer needed
  33. before erasing it!
  34. You can also add one or more files to the file_managed table from this report.
  35. Not on server
  36. -------------
  37. This report lists the files that are in the file_managed database table but
  38. do not exist on the server. These missing files may mean that nodes do not
  39. display as expected, for example, images may not display or downloads may not be
  40. available.
  41. You can also delete any items listed in the report from the database.
  42. Managed not used
  43. ----------------
  44. The files listed in this report are in the file_managed database table but not
  45. in the file_usage table. Usually, this is normal and acceptable. This report
  46. exists for completeness, so you may verify what is here is correct.
  47. Used not managed
  48. ----------------
  49. The files listed in this report are in the file_usage database table but not in
  50. the file_managed table. Files listed here have had their Drupal management
  51. removed, but are still being listed as used somewhere and may have content
  52. referencing them.
  53. You should verify the file's existence on the server and in the objects it is
  54. listed as being used in, and either delete the reference in this report, or add
  55. it to the file_managed table (which is a manual process, due to the fact that
  56. the necessary data is not available to this module).
  57. Used not referenced
  58. -------------------
  59. The files listed here are in the file_usage database table, but the content that
  60. has the file field no longer contains the file reference.
  61. The report lists both the file URI, so you can verify it still is a valid file,
  62. and the file's usages, so you can see where it was being used. Both of those can
  63. be used in determining what needs to happen with the reference.
  64. Referenced not used
  65. -------------------
  66. Listed here are the file references in file fields attached to entities which do
  67. not have a corresponding listing in the file_usage table.
  68. What is listed in this report is the data of references themselves. This can be
  69. used to determine what needs to happen with the reference.
  70. References listed here can either be deleted from the database or added to the
  71. file_usage table.
  72. Merge file references
  73. ---------------------
  74. This report lists all files listed in the file_managed, along with their usages,
  75. grouped by file name. With it, you can merge duplicate file references into a
  76. single one. This reduces records in the database and saves space on the file
  77. system.
  78. BUTTONS ON THE REPORTS
  79. ----------------------
  80. There are anywhere from zero to seven buttons available on any of the file
  81. comparison reports. Below is a description of when the buttons are displayed and
  82. what they do.
  83. At the tops of the reports, there might be one or more of the following buttons,
  84. depending on how you have configured the module: Load first batch set, Load all
  85. records, Load previous batch set, Load next batch set and Reset record
  86. selection.
  87. Load all records
  88. ----------------
  89. If the "Maximum records" field is not zero, this button will be displayed on the
  90. reports. When it is pressed, the report is re-run using Drupal's Batch API, and
  91. will load all records for the report.
  92. Load first batch set
  93. --------------------
  94. If the "Batch set size" field is not zero, this button will be displayed on the
  95. reports. When this button is pressed, the first set of records is loaded, using
  96. Drupal's Batch API, and displayed in the report.
  97. Load next batch set
  98. -------------------
  99. If the "Batch set size" field is not zero, this button will be displayed on the
  100. reports. When it is pressed, the next set of records is loaded, using Drupal's
  101. Batch API, and displayed in the report. Much like paging at the bottom of the
  102. report, this pages records sets through the available records.
  103. Load previous batch set
  104. -----------------------
  105. If the "Batch set size" field is not zero, this button will be displayed on the
  106. reports. When it is pressed, the previous set of records is loaded, using
  107. Drupal's Batch API, and displayed in the report. Much like paging at the bottom
  108. of the report, this pages records sets through the available records.
  109. Reset record selection
  110. ----------------------
  111. If the "Maximum records" field is not zero, this button will be displayed on the
  112. reports. When it is pressed, the variables used for controlling which set of
  113. records and any saved records will be reset and the first page of the report
  114. will be loaded anew.
  115. At the bottoms of the reports, there will be one or both of the following
  116. buttons, depending on the report: Add selected... and Delete selected... (the
  117. text on these buttons is different on the various reports).
  118. Add selected...
  119. ---------------
  120. When there are items selected (checks in the check boxes) on the report and this
  121. button is pressed, the items selected will be added to whatever it is that is
  122. specified in the text of the button (a confirmation page is shown first). i.e.:
  123. if the text of the button is "Add selected items to the database", then the
  124. items will be added to the database.
  125. Delete selected...
  126. ------------------
  127. When there are items selected (checks in the check boxes) on the report and this
  128. button is pressed, the items selected will be deleted from whatever it is the
  129. text specifies on the button (a confirmation page is shown first). i.e.: if the
  130. text of the button is "Delete selected items from the file_usage table", then
  131. the items will be delete from the file_usage database table.
  132. LIMITING FEATURES EXPLAINED
  133. ---------------------------
  134. There are two administrative configuration settings that help with limiting the
  135. records displayed, for when a report times out or exceeds the available memory.
  136. They are: "Maximum records" and "Batch size." They are both found in the "Report
  137. options" fieldset.
  138. There are four possible combinations of these settings, one of which is invalid:
  139. 1) Both set to zero: With these settings, all records are loaded and displayed.
  140. 2) "Maximum records" set to some positive integer grater than zero and "Batch
  141. size." set to zero: With this combination, only the number of records in
  142. "Maximum records" will be initially loaded and displayed. At the top of the
  143. report page, there will be a button labeled "Load all records," with which
  144. you can load all records using Drupal's Batch API. This combination is also
  145. useful if you have a sizable number of records that take a while to display,
  146. but don't time out or exceed the memory limit, as it will allow a quicker
  147. initial load.
  148. 3) "Maximum records" set to zero and "Batch size" set to some positive integer
  149. grater than zero: This combination is invalid, because if "Maximum records"
  150. set to zero, it does not matter what "Batch size" set to, because the
  151. records will never be loaded via the Batch API.
  152. 4) Both set to some positive integer grater than zero: Sometimes, setting
  153. "Maximum records" and batch loading all the records isn't enough, and a
  154. report may still time out or exhaust the available memory. If that is the
  155. case, entering a positive integer in this setting will limit the batch
  156. operation and provide a paging mechanism for accessing the other records.
  157. To test if this will be helpful or not, set it to a lower number. If the
  158. report loads, then set it to a higher number to access more records per
  159. batch load operation. Since it is still using the Batch API, this number can
  160. be rather high, in an attempt to access as many records as possible.
  161. For all options above, paging can be enabled with the "Number of items per page"
  162. setting.
  163. TROUBLESHOOTING
  164. ---------------
  165. You receive the following error messages:
  166. * Warning: Unknown: POST Content-Length of [some number] bytes exceeds the
  167. limit of [some number] bytes in Unknown on line 0
  168. * Warning: Cannot modify header information - headers already sent in Unknown
  169. on line 0
  170. * (And a number of "Notice: Undefined index:..." messages.)
  171. Set the "Maximum records" and "Batch size" settings on the Audit Files
  172. administrative settings configuration page (admin/config/system/auditfiles), and
  173. then use the "Load all records" button on the report that is producing the
  174. error. See the Limiting Features Explained section above for more information.
  175. You receive the following error messages:
  176. * Fatal error: Maximum execution time of [some number] seconds exceeded in
  177. [path to report file] on line [line number]
  178. Set the "Maximum records" and "Batch size" settings on the Audit Files
  179. administrative settings configuration page (admin/config/system/auditfiles), and
  180. then use the "Load all records" button on the report that is producing the
  181. error. See the Limiting Features Explained section above for more information.
  182. MAINTAINERS
  183. -----------
  184. Current maintainers:
  185. * Andrey Andreev (andyceo) - https://www.drupal.org/user/152512
  186. * Jason Flatt (oadaeh) - https://www.drupal.org/user/4649
  187. Previous maintainers:
  188. * Stuart Greenfield (Stuart Greenfield) - https://www.drupal.org/user/54866