Issue Details (XML | Word | Printable)

Key: MODX-322
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Garry Nutting
Reporter: Paul Bohman
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
MODx CMF

add API ability to retrieve any document, irrespective of 'published' or 'deleted' status

Created: 08/Sep/08 12:55 PM   Updated: 15/Jul/09 11:10 PM
Return to search
Component/s: Core Distribution
Affects Version/s: 0.9.6.1, 0.9.6.2-rc1, 0.9.6.2-rc2, 0.9.6.2, 0.9.6.3-rc1, 0.9.6.3-rc2, 0.9.6.3, Evolution-1.0.0
Fix Version/s: Evolution-1.1.0

Time Tracking:
Not Specified

File Attachments: 1. File document.parser.class.inc.php (114 kB)

Environment: all


 Description  « Hide
In trying to create a plugin that is triggered on all events with respect to saving, editing, moving, publishing, and deleting documents, I've found that it would be very beneficial to be able to retrieve all documents, irrespective of their publication or deletion status, without having to duplicate queries. To do this, I modified the following functions slightly:
  • getTemplateVars
  • getTemplateVarOutput
  • getDocuments

No radical change, but now you can use one query in instances where multiple queries would otherwise be required.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul Bohman added a comment - 08/Sep/08 12:56 PM
The attached file has the changes mentioned.

Paul Bohman added a comment - 08/Sep/08 01:02 PM
Oh, and by adding the ability to look for deleted files through getTemplateVars and getTemplateVarOutput, I can now derive a complete document object array from the function even if the document is deleted, whereas without this ability, I'd have to write my own function to create the document object for deleted documents. The default is still to exclude deleted documents.