Asset/Template: bad call to session->db->read
DatabaseLink, typo in sesssion
This commit is contained in:
parent
75aed8bbc5
commit
e1a90f66fd
2 changed files with 3 additions and 3 deletions
|
|
@ -204,11 +204,11 @@ sub getList {
|
|||
my $session = shift;
|
||||
my $namespace = shift;
|
||||
my $sql = "select asset.assetId, assetData.revisionDate from template left join asset on asset.assetId=template.assetId left join assetData on assetData.revisionDate=template.revisionDate and assetData.assetId=template.assetId where template.namespace=".$session->db->quote($namespace)." and template.showInForms=1 and asset.state='published' and assetData.revisionDate=(SELECT max(revisionDate) from assetData where assetData.assetId=asset.assetId and (assetData.status='approved' or assetData.tagId=".$session->db->quote($session->scratch->get("versionTag")).")) order by assetData.title";
|
||||
my $sth = $session->db->read($sql,$session->dbSlave);
|
||||
my $sth = $session->dbSlave->read($sql);
|
||||
my %templates;
|
||||
tie %templates, 'Tie::IxHash';
|
||||
while (my ($id, $version) = $sth->array) {
|
||||
$templates{$id} = WebGUI::Asset::Template->new($id,undef,$version)->getTitle;
|
||||
$templates{$id} = WebGUI::Asset::Template->new($session,$id,undef,$version)->getTitle;
|
||||
}
|
||||
$sth->finish;
|
||||
return \%templates;
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ sub db {
|
|||
my $username = $self->{_databaseLink}{username};
|
||||
my $identifier = $self->{_databaseLink}{identifier};
|
||||
if ($self->getId eq "0") {
|
||||
$self->{_dbh} = $self->sesssion->db;
|
||||
$self->{_dbh} = $self->session->db;
|
||||
return $self->{_dbh};
|
||||
} elsif ($dsn =~ /\DBI\:\w+\:\w+/i) {
|
||||
eval{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue