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

Commit

Permalink
FIX, #12.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Glasl committed Feb 17, 2017
1 parent 8e3e68a commit b89b1c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [mediawesome](https://packagist.org/packages/nglasl/silverstripe-mediawesome)

_The current release is **2.0.2**_
_The current release is **2.0.3**_

> A module for SilverStripe which will allow creation of dynamic media holders/pages with CMS customisable types and attributes (blogs, events, news, publications).
Expand Down
5 changes: 2 additions & 3 deletions code/dataobjects/MediaAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,9 @@ public function onBeforeWrite() {

// Retrieve the respective media type for updating all attribute references.

$parameters = Controller::curr()->getRequest()->requestVars();
$parameters = Controller::has_curr() ? Controller::curr()->getRequest()->requestVars() : null;
$matches = array();
$result = preg_match('#TypesAttributes/item/[0-9]*/#', $parameters['url'], $matches);
if($result) {
if(is_array($parameters) && preg_match('#TypesAttributes/item/[0-9]*/#', $parameters['url'], $matches)) {
$ID = preg_replace('#[^0-9]#', '', $matches[0]);
$pages = MediaPage::get()->innerJoin('MediaType', 'MediaPage.MediaTypeID = MediaType.ID')->where('MediaType.ID = ' . (int)$ID);

Expand Down

0 comments on commit b89b1c9

Please sign in to comment.