replaced return; with return undef;
This commit is contained in:
parent
ffa90c5fbd
commit
fa09c41598
113 changed files with 287 additions and 286 deletions
|
|
@ -267,7 +267,7 @@ sub addChild {
|
|||
|
||||
if ($properties->{className} ne "WebGUI::Asset::Event") {
|
||||
$self->session->errorHandler->security("add a ".$properties->{className}." to a ".$self->get("className"));
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
return $self->SUPER::addChild($properties, @other);
|
||||
|
|
@ -360,7 +360,7 @@ sub createSubscriptionGroup {
|
|||
groupIdSubscription => $group->getId
|
||||
});
|
||||
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -579,7 +579,7 @@ this Calendar.
|
|||
sub getEvent {
|
||||
my $self = shift;
|
||||
my $assetId = shift;
|
||||
# Warn and return if no assetId
|
||||
# Warn and return undef if no assetId
|
||||
$self->session->errorHandler->warn("WebGUI::Asset::Wobject::Calendar->getEvent :: No asset ID."), return
|
||||
unless $assetId;
|
||||
|
||||
|
|
@ -632,10 +632,10 @@ sub getEventsIn {
|
|||
|
||||
my $tz = $self->session->user->profileField("timeZone");
|
||||
|
||||
# Warn and return if no startDate or endDate
|
||||
# Warn and return undef if no startDate or endDate
|
||||
unless ($start && $end) {
|
||||
$self->session->errorHandler->warn("WebGUI::Asset::Wobject::Calendar->getEventsIn() called with not enough arguments at ".join('::',(caller)[1,2]));
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
# Create objects and adjust for timezone
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ sub addChild {
|
|||
if ($properties->{className} ne "WebGUI::Asset::Post::Thread"
|
||||
and $properties->{className} ne 'WebGUI::Asset::RSSFromParent') {
|
||||
$self->session->errorHandler->security("add a ".$properties->{className}." to a ".$self->get("className"));
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
return $self->SUPER::addChild($properties, @other);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -264,11 +264,11 @@ sub addToScratchCart {
|
|||
my $scratchCart = $self->session->scratch->get('EMS_scratch_cart');
|
||||
my @eventsInCart = split("\n",$scratchCart);
|
||||
my ($isApproved) = $self->session->db->quickArray("select approved from EventManagementSystem_products where productId = ?",[$event]);
|
||||
return unless $isApproved;
|
||||
return undef unless $isApproved;
|
||||
unless (scalar(@eventsInCart) || $scratchCart) {
|
||||
# the cart is empty, so check if this is a master event or not.
|
||||
my ($isChild) = $self->session->db->quickArray("select prerequisiteId from EventManagementSystem_products where productId = ?",[$event]);
|
||||
return if $isChild;
|
||||
return undef if $isChild;
|
||||
$self->session->scratch->set('currentMainEvent',$event);
|
||||
$self->session->scratch->set('EMS_scratch_cart', $event);
|
||||
return $event;
|
||||
|
|
@ -276,7 +276,7 @@ sub addToScratchCart {
|
|||
# check if event is actually available.
|
||||
my ($numberRegistered) = $self->session->db->quickArray("select count(*) from EventManagementSystem_registrations as r, EventManagementSystem_purchases as p, transaction as t where t.transactionId=p.transactionId and t.status='Completed' and r.purchaseId = p.purchaseId and r.returned=0 and r.productId=?",[$event]);
|
||||
my ($maxAttendees) = $self->session->db->quickArray("select maximumAttendees from EventManagementSystem_products where productId=?",[$event]);
|
||||
return unless ($self->canApproveEvents || ($maxAttendees > $numberRegistered));
|
||||
return undef unless ($self->canApproveEvents || ($maxAttendees > $numberRegistered));
|
||||
|
||||
my $bid = $self->session->scratch->get('currentBadgeId');
|
||||
my @pastEvents = ($bid)?$self->session->db->buildArray("select r.productId from EventManagementSystem_registrations as r, EventManagementSystem_purchases as p, transaction as t where r.returned=0 and r.badgeId=? and t.transactionId=p.transactionId and t.status='Completed' and p.purchaseId=r.purchaseId group by productId",[$bid]):();
|
||||
|
|
@ -1397,7 +1397,7 @@ sub verifyPrerequisitesForm {
|
|||
my %var;
|
||||
|
||||
#If there is no missing event data, return nothing
|
||||
return unless scalar(@$missingEventMessageLoop);
|
||||
return undef unless scalar(@$missingEventMessageLoop);
|
||||
|
||||
my $i18n = WebGUI::International->new($self->session, 'Asset_EventManagementSystem');
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ sub addAlbumFromCollaboration {
|
|||
$class->addAlbumFromThread( $gallery, $thread );
|
||||
}
|
||||
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -126,7 +126,7 @@ sub addAlbumFromFilesystem {
|
|||
|
||||
# TODO!!!
|
||||
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -198,7 +198,7 @@ sub addAlbumFromThread {
|
|||
}
|
||||
}
|
||||
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ sub addArchive {
|
|||
});
|
||||
$versionTag->requestCommit;
|
||||
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ sub definition {
|
|||
#-------------------------------------------------------------------
|
||||
sub duplicate {
|
||||
# Buggo: how do we duplicate these?
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ sub getGraphConfig {
|
|||
my $self = shift;
|
||||
my $config = $self->get("graphConfiguration");
|
||||
|
||||
return unless $config;
|
||||
return undef unless $config;
|
||||
return $self->thawGraphConfig($config);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ sub _clobberImproperDependants {
|
|||
my $self = shift;
|
||||
my $projectId = shift;
|
||||
my @nondependTaskIds = $self->session->db->buildArray("SELECT sequenceNumber FROM PM_task WHERE projectId = ? AND taskType <> 'timed'", [$projectId]);
|
||||
return unless @nondependTaskIds;
|
||||
return undef unless @nondependTaskIds;
|
||||
$self->session->db->write("UPDATE PM_task SET dependants = NULL WHERE projectId = ? AND dependants IN (".join(', ', ('?') x @nondependTaskIds).")", [$projectId, @nondependTaskIds]);
|
||||
}
|
||||
|
||||
|
|
@ -444,12 +444,12 @@ sub getProjectInstance {
|
|||
my $session = shift;
|
||||
my $db = $session->db;
|
||||
my $projectId = $_[0];
|
||||
return unless $projectId;
|
||||
return undef unless $projectId;
|
||||
my ($assetId) = $db->quickArray("select assetId from PM_project where projectId=?",[$projectId]);
|
||||
if($assetId) {
|
||||
return WebGUI::Asset->newByDynamicClass($session,$assetId);
|
||||
}
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -824,8 +824,8 @@ recent revision will be fetched.
|
|||
sub _getFileFromDatabase {
|
||||
my ($constraint, $dbLink);
|
||||
my $self = shift;
|
||||
my $recordId = shift || return;
|
||||
my $fieldName = shift || return;
|
||||
my $recordId = shift || return undef;
|
||||
my $fieldName = shift || return undef;
|
||||
my $revision = shift;
|
||||
|
||||
$dbLink = $self->_getDbLink;
|
||||
|
|
@ -4086,7 +4086,7 @@ sub _constructSearchQuery {
|
|||
|
||||
my $searchType = ($self->session->form->process("searchType") || $self->session->scratch->get('SQLForm_'.$self->getId.'searchType')) eq 'and' ? 'and' : 'or';
|
||||
|
||||
return if (!@constraints);
|
||||
return undef if (!@constraints);
|
||||
|
||||
# Construct the search query
|
||||
my $sortField = @sortClauses ? ('('.join('+', @sortClauses).') AS sqlform_orderby') : '1 AS sqlform_orderby';
|
||||
|
|
@ -4260,7 +4260,7 @@ sub _clearScratch {
|
|||
$scratch->delete("SQLForm_${id}$tag");
|
||||
}
|
||||
|
||||
return; # nothing explicitly
|
||||
return undef; # nothing explicitly
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ sub getEditForm {
|
|||
function toggleQuery(Id) {
|
||||
queryClass = "query" + Id;
|
||||
var tr = document.getElementsByTagName("tr");
|
||||
if (tr == null) return;
|
||||
if (tr == null) return undef;
|
||||
for (i=0; i < tr.length; i++) {
|
||||
if(tr[i].className == queryClass) {
|
||||
if(tr[i].style.display == 'none') {
|
||||
|
|
@ -384,7 +384,7 @@ sub download {
|
|||
my $self = shift;
|
||||
|
||||
# Instead of going through some costly exercises...
|
||||
return if ($self->getValue("downloadType") eq "none");
|
||||
return undef if ($self->getValue("downloadType") eq "none");
|
||||
|
||||
# Initiate an empty debug loop
|
||||
$self->{_debug_loop} = [] ;
|
||||
|
|
@ -419,7 +419,7 @@ sub download {
|
|||
}
|
||||
else {
|
||||
# I don't know what to do
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -705,7 +705,7 @@ sub www_download {
|
|||
my $self = shift;
|
||||
|
||||
# Only allow if download type is not "none"
|
||||
return if $self->getValue("downloadType") eq "none";
|
||||
return undef if $self->getValue("downloadType") eq "none";
|
||||
|
||||
# Only allow users in appropriate group
|
||||
return $self->session->privilege->noAccess()
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ sub _convertToEpoch {
|
|||
my $time = $_[1];
|
||||
|
||||
unless ($date =~ m{^\d+/\d+/\d+} and $time =~ m{^\d+:\d+}) {
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
my ($month,$day,$year) = split("/",$date);
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ sub _find_record {
|
|||
}
|
||||
}
|
||||
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -338,7 +338,7 @@ sub _get_rss_data {
|
|||
if (!$response->is_success()) {
|
||||
$session->errorHandler->warn("Error retrieving url '$url': " .
|
||||
$response->status_line());
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
my $xml = $response->content();
|
||||
|
||||
|
|
@ -370,7 +370,7 @@ sub _get_rss_data {
|
|||
$session->errorHandler->warn("error parsing rss for url $url :".$@);
|
||||
#Returning undef on a parse failure is a change from previous behaviour,
|
||||
#but it SHOULDN'T have a major effect.
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
# make sure that the {channel} points to the channel
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ sub view {
|
|||
|
||||
# hashref
|
||||
} elsif (ref $return eq 'HASH') {
|
||||
@result = $return;
|
||||
@result = $return undef;
|
||||
|
||||
# blessed object, to be stripped with Data::Structure::Util
|
||||
} elsif ( ref $return) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue