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

Commit

Permalink
Updating the module to support 3.2.X.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Glasl committed Mar 16, 2016
1 parent d3f60d8 commit 93acb6c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# [fusion](https://packagist.org/packages/nglasl/silverstripe-fusion)

_The current release is **1.0.5**_
_The current release is **1.1.0**_

A module for SilverStripe which will automatically consolidate existing tag types
into new fusion tags, and allows searchable content tagging out of the box.

## Requirement

* SilverStripe 3.1.X
* SilverStripe 3.2.X

## Getting Started

Expand Down
5 changes: 4 additions & 1 deletion code/dataobjects/FusionTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ public function validate() {
if($result->valid() && !$this->Title) {
$result->error('"Title" required!');
}
else if($result->valid() && FusionTag::get_one('FusionTag', "ID != " . (int)$this->ID . " AND Title = '" . Convert::raw2sql($this->Title) . "'")) {
else if($result->valid() && FusionTag::get_one('FusionTag', array(
'ID != ?' => $this->ID,
'Title = ?' => $this->Title
))) {
$result->error('Tag already exists!');
}

Expand Down
5 changes: 4 additions & 1 deletion code/extensions/FusionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ public function validate(ValidationResult $result) {
if($result->valid() && !$this->owner->$validate) {
$result->error("\"{$validate}\" required!");
}
else if($result->valid() && $class::get_one($class, "ID != " . (int)$this->owner->ID . " AND {$validate} = '" . Convert::raw2sql($this->owner->$validate) . "'")) {
else if($result->valid() && $class::get_one($class, array(
'ID != ?' => $this->owner->ID,
"{$validate} = ?" => $this->owner->$validate
))) {
$result->error('Tag already exists!');
}

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"email": "nathan@silverstripe.com.au"
}],
"require": {
"silverstripe/cms": "3.1.*",
"silverstripe/framework": "3.1.*"
"silverstripe/cms": "3.2.*",
"silverstripe/framework": "3.2.*"
},
"extra": {
"installer-name": "fusion",
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "1.1.x-dev"
},
"screenshots": [
"https://raw.githubusercontent.com/nglasl/silverstripe-fusion/master/images/fusion-tag.png"
Expand Down

0 comments on commit 93acb6c

Please sign in to comment.