BlogTag existing check on URLSegment

perform existing check for BlogTag on URLSegment rather than Title. 
Title is non unique in the Database, thus allows (ci) duplicates in legacy entries
This commit is contained in:
Max Girkens 2018-06-21 13:23:08 +02:00 committed by GitHub
parent 45c4a4aadf
commit 3b17c4478e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -88,7 +88,7 @@ class BlogTag extends DataObject implements CategorisationObject
// Check for duplicate tags
$blog = $this->Blog();
if($blog && $blog->exists()) {
$existing = $blog->Tags()->filter('Title', $this->Title);
$existing = $blog->Tags()->filter('URLSegment', $this->URLSegment);
if($this->ID) {
$existing = $existing->exclude('ID', $this->ID);
}