Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Avoid Duplicate entry in db #10

Merged
merged 1 commit into from

3 participants

@ternel

If you already have a "jquery" tag and someone try to add a "jQuery" tag, there's an error :
Integrity constraint violation: 1062 Duplicate entry 'jQuery'

To avoid this error, Tag Manager now makes a case insensitive comparaison of the tag name.

@ternel ternel Avoid duplicate entry error when you have tags like jquery / jQuery. …
…TagManger now go a case insensitive comparaison of tag name
a487e89
@ghost

please merge this into master.

@ribeiropaulor

Is this project left alone? This is an important merge.

@FabienPennequin FabienPennequin merged commit ee7245f into FabienPennequin:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 17, 2012
  1. @ternel

    Avoid duplicate entry error when you have tags like jquery / jQuery. …

    ternel authored
    …TagManger now go a case insensitive comparaison of tag name
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/DoctrineExtensions/Taggable/TagManager.php
View
2  lib/DoctrineExtensions/Taggable/TagManager.php
@@ -128,7 +128,7 @@ public function loadOrCreateTags(array $names)
$loadedNames[] = $tag->getName();
}
- $missingNames = array_diff($names, $loadedNames);
+ $missingNames = array_udiff($names, $loadedNames, 'strcasecmp');
if (sizeof($missingNames)) {
foreach ($missingNames as $name) {
$tag = $this->createTag($name);
Something went wrong with that request. Please try again.