From 078f5587c7545926e268598f63c6cc47c97fa8e2 Mon Sep 17 00:00:00 2001 From: Scott Walters Date: Mon, 6 Dec 2010 16:56:24 -0500 Subject: [PATCH] When FileUrl returns an error message instead of a filename and the thing hotlinks it (eg, img src), the evidence of the problem doesn't show up until the next hit. Even more fun, the error message gets lower-case-ified as part of conicialization so if you ack for it without -i, you won't even find where the error came from. So perhaps it's best to log the error sooner than later. --- lib/WebGUI/Macro/FileUrl.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/WebGUI/Macro/FileUrl.pm b/lib/WebGUI/Macro/FileUrl.pm index c843e293c..ae770e2e4 100644 --- a/lib/WebGUI/Macro/FileUrl.pm +++ b/lib/WebGUI/Macro/FileUrl.pm @@ -45,14 +45,17 @@ sub process { my $asset = WebGUI::Asset->newByUrl($session,$url); my $i18n = WebGUI::International->new($session, 'Macro_FileUrl'); if (not defined $asset) { + $session->log->warn("Invalid Asset URL for url: " . $url); return $i18n->get('invalid url'); } my $storageId = $asset->get('storageId'); if (not defined $storageId) { + $session->log->warn("No Storage Location for assetId: " . $asset->getId . " url: $url"); return $i18n->get('no storage'); } my $filename = $asset->get('filename'); if (not defined $filename) { + $session->log->warn("No Filename for assetId: " . $asset->getId . " url: $url"); return $i18n->get('no filename'); } my $storage = WebGUI::Storage->get($session,$storageId);