Based on SVN history, put the behavior of the SQL back and fixed the POD and
the tests.
This commit is contained in:
parent
5a379fe91e
commit
4469301092
2 changed files with 4 additions and 4 deletions
|
|
@ -1885,7 +1885,7 @@ A hash reference of optional parameters.
|
||||||
|
|
||||||
head4 assetId
|
head4 assetId
|
||||||
|
|
||||||
Limit the search to a specific assetId to see if that url exists for that asset.
|
Excludes an asset, by assetId, for the search for the existance of the url.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -1897,7 +1897,7 @@ sub urlExists {
|
||||||
my $limit = "";
|
my $limit = "";
|
||||||
my $placeholders = [ $url ];
|
my $placeholders = [ $url ];
|
||||||
if (exists $options->{assetId}) {
|
if (exists $options->{assetId}) {
|
||||||
$limit = "and assetId=?";
|
$limit = "and assetId<>?";
|
||||||
push @{ $placeholders }, $options->{assetId};
|
push @{ $placeholders }, $options->{assetId};
|
||||||
}
|
}
|
||||||
my ($test) = $session->db->quickArray("select count(url) from assetData where url=? $limit", $placeholders);
|
my ($test) = $session->db->quickArray("select count(url) from assetData where url=? $limit", $placeholders);
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,6 @@ my $importId = $importNode->getId;
|
||||||
|
|
||||||
ok( WebGUI::Asset->urlExists($session, $importUrl), 'url for import node exists');
|
ok( WebGUI::Asset->urlExists($session, $importUrl), 'url for import node exists');
|
||||||
ok( !WebGUI::Asset->urlExists($session, '/foo/bar/baz'), 'made up url does not exist');
|
ok( !WebGUI::Asset->urlExists($session, '/foo/bar/baz'), 'made up url does not exist');
|
||||||
ok( WebGUI::Asset->urlExists($session, $importUrl, {assetId => $importId}), 'url for import node exists at specific id');
|
ok( !WebGUI::Asset->urlExists($session, $importUrl, {assetId => $importId}), 'url for import node only exists at specific id');
|
||||||
ok( !WebGUI::Asset->urlExists($session, '/foo/bar/baz', {assetId => $importId}), 'imaginary url does not exist at specific id');
|
ok( !WebGUI::Asset->urlExists($session, '/foo/bar/baz', {assetId => $importId}), 'imaginary url does not exist at specific id');
|
||||||
ok( !WebGUI::Asset->urlExists($session, $importUrl, {assetId => 'notAnWebGUIId'}), 'imaginary url does not exist at wrong id');
|
ok( WebGUI::Asset->urlExists($session, $importUrl, {assetId => 'notAnWebGUIId'}), 'imaginary url does not exist at wrong id');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue