Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
Correcting an issue regarding new media type attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Glasl committed Jul 9, 2015
1 parent f3c7b31 commit 0258e6c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/dataobjects/MediaAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class MediaAttribute extends DataObject {
'MediaPage' => 'MediaPage'
);

private static $default_sort = 'Title';

/**
* Flag a write occurrence to prevent infinite recursion.
*/
Expand Down Expand Up @@ -134,7 +136,7 @@ public function onBeforeWrite() {

$parameters = Controller::curr()->getRequest()->requestVars();
$matches = array();
$result = preg_match('#MediaTypes/item/[0-9]*/#', $parameters['url'], $matches);
$result = preg_match('#TypesAttributes/item/[0-9]*/#', $parameters['url'], $matches);
if($result) {
$ID = preg_replace('#[^0-9]#', '', $matches[0]);
$pages = MediaPage::get()->innerJoin('MediaType', 'MediaPage.MediaTypeID = MediaType.ID')->where('MediaType.ID = ' . (int)$ID);
Expand Down
2 changes: 2 additions & 0 deletions code/dataobjects/MediaTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class MediaTag extends DataObject {
'Title' => 'Varchar(255)'
);

private static $default_sort = 'Title';

/**
* Allow access for CMS users viewing tags.
*/
Expand Down
2 changes: 2 additions & 0 deletions code/dataobjects/MediaType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class MediaType extends DataObject {
'Title' => 'Varchar(255)'
);

private static $default_sort = 'Title';

/**
* The default media types.
*/
Expand Down

0 comments on commit 0258e6c

Please sign in to comment.