Project

General

Profile

« Previous | Next » 

Revision 4741

Added by walbridge over 15 years ago

Fix issue with missing AdminDB parameters causing the registry script to fail (Bug #3741)

View differences:

src/perl/register-dataset.cgi
4180 4180
        my $admindb = NCEAS::AdminDB->new();
4181 4181

  
4182 4182
        # populate db parameters for NCEAS AdminDB
4183
        my $db = $properties->splitToTree(qr/\./, 'registry.db');
4183
        my $db = $skinProperties->splitToTree(qr/\./, 'registry.db');
4184 4184

  
4185
        $admindb->connect($db->{'connection'}, $db->{'user'}, $db->{'password'});
4186
        if ($admindb->{'connected'}) {
4187
            $projects = $admindb->getProjects();
4185
        # check all neccessary parameters exist
4186
        if (!$db->{'connection'} || !$db->{'user'} || !$db->{'password'}) {
4187
            debug("NCEAS AdminDB misconfigured. Check database configuration parameters, in the registry.db section of nceas.properties.");
4188
            $projects = getTestProjectList();
4188 4189
        } else {
4189
            $projects = $admindb->getTestProjectList();
4190
            $admindb->connect($db->{'connection'}, $db->{'user'}, $db->{'password'});
4191
            if ($admindb->{'connected'}) {
4192
                $projects = $admindb->getProjects();
4193
            } else {
4194
                $projects = getTestProjectList();
4195
            }
4190 4196
        }
4191 4197
    }
4192 4198
    return $projects;

Also available in: Unified diff