From 469950a1ef2105174d98ff49d77a2bb59deb0497 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 12 Aug 2005 16:37:23 +0000 Subject: [PATCH] more bug fixes --- docs/upgrades/upgrade_6.6.5-6.7.0.pl | 1 + lib/WebGUI/Storage.pm | 8 +++++++- www/extras/assetManager/assetManager.js | 3 ++- www/extras/contextMenu/contextMenu.js | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/upgrades/upgrade_6.6.5-6.7.0.pl b/docs/upgrades/upgrade_6.6.5-6.7.0.pl index 65ca5f946..7778ceeba 100644 --- a/docs/upgrades/upgrade_6.6.5-6.7.0.pl +++ b/docs/upgrades/upgrade_6.6.5-6.7.0.pl @@ -298,6 +298,7 @@ sub addAssetVersioning { $sth = WebGUI::SQL->read("select olderVersions from FileAsset"); while (my ($old) = $sth->array) { foreach my $storageId (split("\n",$old)) { + next unless ($storageId); WebGUI::Storage->get($storageId)->delete; } } diff --git a/lib/WebGUI/Storage.pm b/lib/WebGUI/Storage.pm index 6dbf736a1..05e25cbaf 100644 --- a/lib/WebGUI/Storage.pm +++ b/lib/WebGUI/Storage.pm @@ -352,7 +352,8 @@ Deletes this storage location and its contents (if any) from the filesystem and sub delete { my $self = shift; - rmtree($self->getPath); + my $path = $self->getPath; + rmtree($path) if ($path); undef $self; } @@ -390,6 +391,7 @@ The unique identifier for this file system storage location. sub get { my $class = shift; my $id = shift; + return undef unless $id; $id =~ m/^(.{2})(.{2})/; my $self = {_id => $id, _part1 => $1, _part2 => $2}; bless $self, ref($class)||$class; @@ -587,6 +589,10 @@ If specified, we'll return a path to the file rather than the storage location. sub getPath { my $self = shift; my $file = shift; + unless ($session{config}{uploadsPath} && $self->{_part1} && $self->{_part2} && $self->getId) { + $self->_addError("storage object malformed"); + return undef; + } my $path = $session{config}{uploadsPath} .$session{os}{slash}.$self->{_part1} .$session{os}{slash}.$self->{_part2} diff --git a/www/extras/assetManager/assetManager.js b/www/extras/assetManager/assetManager.js index 4ec9ed66a..e91e462aa 100644 --- a/www/extras/assetManager/assetManager.js +++ b/www/extras/assetManager/assetManager.js @@ -471,7 +471,8 @@ function AssetManager_addAssetMetaData(url, rank,title) { //********Event Handlers*********** function AssetManager_initializeDragEventHandlers() { - document.onmousedown=AssetManager_documentMouseDown; + var old = (document.onmousedown) ? document.onmousedown : function () {}; + document.onmousedown= function () {old();AssetManager_documentMouseDown();}; document.onmouseup=AssetManager_documentMouseUp; document.onmousemove=AssetManager_documentMouseMove; } diff --git a/www/extras/contextMenu/contextMenu.js b/www/extras/contextMenu/contextMenu.js index 15751f951..6b7c5893f 100755 --- a/www/extras/contextMenu/contextMenu.js +++ b/www/extras/contextMenu/contextMenu.js @@ -1,7 +1,8 @@ var ie5=document.all&&document.getElementById var contextMenu_items = new Array(); -document.onmousedown=contextMenu_hide; +var contextMenu_old = (document.onmousedown) ? document.onmousdown : function () {}; +document.onmousedown= function () {contextMenu_old();contextMenu_hide();}; function contextMenu_renderLeftClick(menuId,e) { contextMenu_hide(e);