[Rt-commit] rt branch, 5.0/articles-unique-only-within-own-class, updated. rt-5.0.1-3-g211daa2517

Steve Burr steve at bestpractical.com
Tue May 18 10:06:00 EDT 2021


The branch, 5.0/articles-unique-only-within-own-class has been updated
       via  211daa251735722dd84d5f7f14383169a55e31eb (commit)
      from  dda7e71209bb4ecef2fb1f8293686b3411ad06dd (commit)

Summary of changes:
 lib/RT/Article.pm | 4 ----
 1 file changed, 4 deletions(-)

- Log -----------------------------------------------------------------
commit 211daa251735722dd84d5f7f14383169a55e31eb
Author: Steven Burr <steve at bestpractical.com>
Date:   Tue May 18 10:03:17 2021 -0400

    Disallow multiple articles with empty names
    
    Empty article names are permitted, but not further checked
    for uniqueness. This change makes an empty article name just like
    other valid article names and requires it to be unique in the same
    way--either globally or per Class depending on how ValidateName
    was called.

diff --git a/lib/RT/Article.pm b/lib/RT/Article.pm
index 636d6ce227..a8f3719c56 100644
--- a/lib/RT/Article.pm
+++ b/lib/RT/Article.pm
@@ -247,10 +247,6 @@ sub ValidateName {
     my $name = shift;
     my $class_id = shift || ($self->ClassObj && $self->ClassObj->id) || $self->{'_creating_class'};
 
-    if ( !$name ) {
-        return (1);
-    }
-
     if ( $class_id ) {
         my $articles = RT::Articles->new($RT::SystemUser);
         $articles->Limit( FIELD => 'Name', OPERATOR => '=', VALUE => $name );  # cannot use LimitName() as it hardcodes 'LIKE'

-----------------------------------------------------------------------


More information about the rt-commit mailing list