[mb-commits] r8890 - in mb_server/trunk: . htdocs/edit/artist

root at musicbrainz.org root at musicbrainz.org
Sat Mar 10 11:22:52 UTC 2007


Author: luks
Date: 2007-03-10 11:22:51 +0000 (Sat, 10 Mar 2007)
New Revision: 8890

Modified:
   mb_server/trunk/CHANGES
   mb_server/trunk/htdocs/edit/artist/edit.html
Log:
Fixed case-insensitive duplicate artist check. (Closes #1299, #84)

Both these tickets were basically already fixed. Only the 'Edit Artist' page (case sensitive) worked a little differently than the 'Add Artist' one (case insensitive).


Modified: mb_server/trunk/CHANGES
===================================================================
--- mb_server/trunk/CHANGES	2007-03-10 10:51:41 UTC (rev 8889)
+++ mb_server/trunk/CHANGES	2007-03-10 11:22:51 UTC (rev 8890)
@@ -14,6 +14,7 @@
    * JavaScript toolbox for quick AR adding.
    * Adding an artist with 'feat.' in the name will give the user
      an warning. (#787)
+   * Updated e-mail templates. (#2247)
 
  * Bug Fixes:
    * Fixed ':hover' CSS for voting radiobuttons in IE7. (#2352)
@@ -27,6 +28,10 @@
      more similar to other edit types. (#2092)
    * Fixed centering of date form fields. (#2097)
    * Don't unset release events on the similar release screen. (#1992)
+   * Fixed displaying of sortnames and artist comments in the
+     relationship box. (#2111)
+   * Case-insensitive duplicate artist name check on the 'Edit Artist'
+     page. (#1299, #84)
 
 ********************************************************************************
 ********************************************************************************

Modified: mb_server/trunk/htdocs/edit/artist/edit.html
===================================================================
--- mb_server/trunk/htdocs/edit/artist/edit.html	2007-03-10 10:51:41 UTC (rev 8889)
+++ mb_server/trunk/htdocs/edit/artist/edit.html	2007-03-10 11:22:51 UTC (rev 8890)
@@ -91,27 +91,16 @@
 
 	# Try to load the named artist by name. If an artist comes up,
 	# give the user a stern warning about editing a duplicate artist.
-	my ($samecheck, $samename) = (1, 0);
 	my @dupes;
-	my $dupar = Artist->new($mb->{DBH});
-	my $artists = $dupar->GetArtistsFromName($name);
-	if (defined $artists && scalar(@$artists))
+	if ($name ne "")
 	{
-		foreach my $item (@$artists)
-		{
-			# do not check same entity.
-			next if ($item->GetId == $artist->GetId);
+		my $artist = Artist->new($mb->{DBH});
+		my $artists = $artist->GetArtistsFromName($name);
 
-			# if entity has the same name, and the resolution
-			# is set, store this artist as the duplicate.
-			$samename = $item->GetName eq $name;
-			push @dupes, $item if ($samename);
-			if ($samecheck)
-			{
-				$samecheck = ($samename && $resolution ne "") ? 1 : 0 if ($samename);
-				$dupar = $item if ($samename);
-			}
-		}
+		my $norm_name = MusicBrainz::Server::Validation::NormaliseSortText($name);
+		@dupes = grep {
+			MusicBrainz::Server::Validation::NormaliseSortText($_->GetName) eq $norm_name
+		} @$artists;
 	}
 
 	# if we have a value in submitvalue, the form was submitted
@@ -154,10 +143,6 @@
 			# the new artist entry.
 			if (@messages == 0)
 			{
-				# If the artist is not deemed to be the same as another artist, don't save the comment
-				# --> commented out for now.
-				# $resolution = "" if (!$samename);
-
 				$m->comp(
 					"/comp/entermods",
 					DBH => $mb->{DBH},




More information about the MusicBrainz-commits mailing list