Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.

Commit

Permalink
Fixed source not being selected in CSV download
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Olde Hampsink committed Dec 10, 2014
1 parent 425b356 commit d357223
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions controllers/AuditLogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public function actionDownload()
// Get criteria
$criteria = craft()->elements->getCriteria('AuditLog', craft()->request->getParam('criteria'));

// Get element type
$elementType = craft()->elements->getElementType('AuditLog');

// Get order and sort
$viewState = craft()->request->getParam('viewState', array(
'order' => 'id',
Expand All @@ -23,14 +26,15 @@ public function actionDownload()
$criteria->search = craft()->request->getParam('search');

// Get source
$criteria->source = craft()->request->getParam('source', '*');
$sources = $elementType->getSources();
$source = craft()->request->getParam('source', '*');

// Set type
$criteria->type = $source != '*' ? $sources[$source]['criteria']['type'] : null;

// Get data
$log = craft()->auditLog->log($criteria);

// Get element type
$elementType = craft()->elements->getElementType('AuditLog');

// Set status attribute
$attributes['status'] = Craft::t('Status');

Expand Down
2 changes: 1 addition & 1 deletion elementtypes/AuditLogElementType.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function getIndexHtml($criteria, $disabledElementIds, $viewState, $source

} else {

// Get sortable attribuets
// Get sortable attributes
$sortableAttributes = $this->defineSortableAttributes();

if($sortableAttributes) {
Expand Down

0 comments on commit d357223

Please sign in to comment.