mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
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:
parent
45c4a4aadf
commit
3b17c4478e
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user