add new error message to FileUrl macro
This commit is contained in:
parent
10135118d2
commit
c1246444e0
3 changed files with 13 additions and 1 deletions
|
|
@ -17,6 +17,8 @@
|
|||
- Fixed typo in template variable project.gantt.rowspan and documentation
|
||||
- fix: Events Calendar Double Date (Wouter van Oijen / ProcoliX)
|
||||
- fix: Data Form Text Area Box Non-Existent (Wouter van Oijen / ProcoliX)
|
||||
- Added an error message to the FileUrl macro to help users figure out why it
|
||||
doesn't work.
|
||||
|
||||
|
||||
7.0.2
|
||||
|
|
|
|||
|
|
@ -50,9 +50,14 @@ sub process {
|
|||
}
|
||||
my $storageId = $asset->get('storageId');
|
||||
if (not defined $storageId) {
|
||||
$session->errorHandler->warn("^FileUrl($url): asset is not a file");
|
||||
$session->errorHandler->warn("^FileUrl($url): asset does not store files");
|
||||
return $i18n->get('no storage');
|
||||
}
|
||||
my $filename = $asset->get('filename');
|
||||
if (not defined $filename) {
|
||||
$session->errorHandler->warn("^FileUrl($url): asset does not have a 'filename' property");
|
||||
return $i18n->get('no filename');
|
||||
}
|
||||
my $storage = WebGUI::Storage->get($session,$storageId);
|
||||
return $storage->getUrl($asset->get("filename"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@ This macro is used to return a filesystem URL to a File or Image Asset identifie
|
|||
lastUpdated => 1153498370,
|
||||
},
|
||||
|
||||
'no filename' => {
|
||||
message => q|The Asset you requested does not have a filename property.|,
|
||||
lastUpdated => 1153618016,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue