diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 3d8dd793b..1ad3db9e1 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -9,6 +9,25 @@ save you many hours of grief. 6.3.0 -------------------------------------------------------------------- + * Your upgrade process will be a little different from here on out. + Use the following steps to do the upgrade: + + a) Back up everything. + + b) Extract the 6.3 archive over your existing install. + + c) Restart apache (don't shut down as normal, just restart). + + d) Run upgrade.pl in the sbin folder. + + e) Test. + + The reason for this is that WebGUI has an innovative new way + of releasing sites for public view as soon as they become + available during the upgrade, even while the other sites are + still being upgraded. Each site will have a maintenance + message displayed until its upgrade is complete. + * This upgrade process will run for a very long time and output a lot of debug information which will be useful if something goes wrong. You may wish to pipe the debug info to a log diff --git a/docs/upgrades/upgrade_6.2.11-6.3.0.pl b/docs/upgrades/upgrade_6.2.11-6.3.0.pl index 9f8b6865f..7112d9782 100644 --- a/docs/upgrades/upgrade_6.2.11-6.3.0.pl +++ b/docs/upgrades/upgrade_6.2.11-6.3.0.pl @@ -374,15 +374,9 @@ while (my $data = $sth->hashRef) { } elsif ($data->{method} eq "generation") { $newNav{assetsToInclude} = "self\nsisters"; } elsif ($data->{method} eq "ancestors") { - $newNav{endPoint} += $newNav{startPoint} unless ($newNav{startType} eq "specificUrl"); - $newNav{startType} = "relativeToRoot"; - $newNav{startPoint} = $data->{stopAtLevel}+1; - $newNav{assetsToInclude} = "descendants"; + $newNav{assetsToInclude} = "ancestors"; } elsif ($data->{method} eq "self_and_ancestors") { - $newNav{endPoint} += $newNav{startPoint} unless ($newNav{startType} eq "specificUrl"); - $newNav{startType} = "relativeToRoot"; - $newNav{startPoint} = $data->{stopAtLevel}+1; - $newNav{assetsToInclude} = "self\ndescendants"; + $newNav{assetsToInclude} = "self\nancestors"; } elsif ($data->{method} eq "pedigree") { $newNav{endPoint} = 55; $newNav{startType} = "relativeToRoot"; @@ -1196,6 +1190,7 @@ $sth->finish; print "\tDeleting files which are no longer used.\n" unless ($quiet); +#unlink("../../lib/WebGUI/Macro/SI_scaledImage.pm"); #unlink("../../lib/WebGUI/Export.pm"); #unlink("../../lib/WebGUI/MetaData.pm"); #unlink("../../lib/WebGUI/Operation/MetaData.pm"); @@ -1262,6 +1257,7 @@ my $macros = $conf->get("macros"); delete $macros->{"\\"}; delete $macros->{"Backslash_pageUrl"}; delete $macros->{"I_imageWithTags"}; +delete $macros->{"SI_scaledImage"}; delete $macros->{"Snippet"}; delete $macros->{"Navigation"}; delete $macros->{"File"}; @@ -1354,7 +1350,7 @@ $nestedMacro = qr /(\^ # Start with carat }gx; push(@parsed, undef) if substr($params,-1,1) eq ','; my $result; - if (isIn($searchString, qw(Navigation I Snippet File))) { + if (isIn($searchString, qw(Navigation SI I Snippet File))) { my $url = (exists $macroCache{$parsed[0]}) ? $macroCache{$parsed[0]} : $parsed[0]; $result = '^AssetProxy("'.$url.'");'; } elsif (isIn($searchString, qw(RandomSnippet RandomImage))) { @@ -1809,7 +1805,7 @@ sub walkTree { my $b = WebGUI::SQL->read("select assetId, templatePosition from wobject where pageId=".quote($page->{pageId})." order by templatePosition, sequenceNumber"); while (my ($assetId, $position) = $b->array) { - if ($position ne $last) { + if ($position != $last) { push(@positions,join(",",@assets)); @assets = (); } @@ -1817,6 +1813,7 @@ sub walkTree { push(@assets,$assetId); } $b->finish; + push(@positions,join(",",@assets)); my $contentPositions = join("\.",@positions); WebGUI::SQL->write("update Layout set contentPositions=".quote($contentPositions)." where assetId=".quote($pageId)); } diff --git a/docs/upgrades/upgrade_6.2.11-6.3.0.sql b/docs/upgrades/upgrade_6.2.11-6.3.0.sql index eff69c98e..d114f808d 100644 --- a/docs/upgrades/upgrade_6.2.11-6.3.0.sql +++ b/docs/upgrades/upgrade_6.2.11-6.3.0.sql @@ -222,8 +222,8 @@ INSERT INTO template VALUES ('7','Side By Side','\"> INSERT INTO template VALUES ('6','Right Column','\">\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n
 
\r\n\r\n
\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
 
\r\n\r\n\r\n \r\n
 
\r\n \r\n
\r\n ','page',1,1); INSERT INTO template VALUES ('1','Default Page','\">\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n\r\n \r\n
 
\r\n \r\n
\r\n ','page',1,1); -INSERT INTO template VALUES ('1','File','\r\n\r\n\r\n\">\" alt=\"\" border=\"0\" />','FileAsset',1,1); -INSERT INTO template VALUES ('2','Image','\r\n\r\n\r\n\" />','ImageAsset',1,1); +INSERT INTO template VALUES ('1','File','

\">\" alt=\"\" border=\"0\" />','FileAsset',1,1); +INSERT INTO template VALUES ('2','Image','

\" />','ImageAsset',1,1); INSERT INTO template VALUES ('15','File Folder','\">\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n
\">\" border=\"0\" alt=\"\"> \">
\">\" border=\"0\" alt=\"\"> \">^D(\"%z %Z\",);
', 'Folder',1,1); diff --git a/lib/WebGUI/Asset/File.pm b/lib/WebGUI/Asset/File.pm index 11ef82b9a..11c5ec9e6 100644 --- a/lib/WebGUI/Asset/File.pm +++ b/lib/WebGUI/Asset/File.pm @@ -248,7 +248,6 @@ sub view { my $self = shift; my %var = %{$self->get}; $var{controls} = $self->getToolbar; - $var{controls} = '

'.$var{controls}.'

' if (exists $var{controls}); $var{fileUrl} = $self->getFileUrl; $var{fileIcon} = $self->getFileIconUrl; return $self->processTemplate(\%var,"PBtmpl0000000000000024"); diff --git a/lib/WebGUI/Asset/File/Image.pm b/lib/WebGUI/Asset/File/Image.pm index f64b6b0d3..0957f9576 100644 --- a/lib/WebGUI/Asset/File/Image.pm +++ b/lib/WebGUI/Asset/File/Image.pm @@ -193,7 +193,6 @@ sub view { my $self = shift; my %var = %{$self->get}; $var{controls} = $self->getToolbar; - $var{controls} = '

'.$var{controls}.'

' if (exists $var{controls}); $var{fileUrl} = $self->getFileUrl; $var{fileIcon} = $self->getFileIconUrl; $var{thumbnail} = $self->getThumbnailUrl; diff --git a/lib/WebGUI/Asset/Wobject/Navigation.pm b/lib/WebGUI/Asset/Wobject/Navigation.pm index 8947803de..3c9848b70 100644 --- a/lib/WebGUI/Asset/Wobject/Navigation.pm +++ b/lib/WebGUI/Asset/Wobject/Navigation.pm @@ -111,6 +111,11 @@ sub getEditForm { $tabform->getTab("properties")->readOnly( -label=>"Relatives to Include", -value=>WebGUI::Form::checkbox({ + checked=>$selfChecked, + name=>"assetsToInclude", + value=>"ancestors" + }).'Ancestors
' + .WebGUI::Form::checkbox({ checked=>$selfChecked, name=>"assetsToInclude", value=>"self" diff --git a/lib/WebGUI/Macro/SI_scaledImage.pm b/lib/WebGUI/Macro/SI_scaledImage.pm deleted file mode 100644 index e65457fd4..000000000 --- a/lib/WebGUI/Macro/SI_scaledImage.pm +++ /dev/null @@ -1,125 +0,0 @@ -package WebGUI::Macro::SI_scaledImage; - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2005 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -use strict; -use WebGUI::Collateral; -use WebGUI::Macro; -use WebGUI::ErrorHandler; -use WebGUI::Session; -use WebGUI::Utility; - -# test for Image::Magick - -# (Would be nice if the results of this test were availiable somewhere -# central) - -my $hasImageMagick=1; -eval " use Image::Magick; "; $hasImageMagick=0 if $@; - -#------------------------------------------------------------------- -sub _getImage { - my ($collateral) = @_; - return undef unless ($hasImageMagick); - my $image = Image::Magick->new(); - if (my $error = $image->Read($collateral->getPath)) { - WebGUI::ErrorHandler::warn("Couldn't read image for resizing: ".$error); - return undef; - } - return $image; -} - -#------------------------------------------------------------------- -sub process { - my ($collateralIdent,$width,$height,$parameters) = WebGUI::Macro::getParams($_[0]); - my ($collateral,$url); - - if ($collateralIdent =~ /[\w|\-]{22}/) { - $collateral = WebGUI::Collateral->new($collateralIdent); - } - else { - $collateral = WebGUI::Collateral->find($collateralIdent); - } - - unless ($collateral) { - WebGUI::ErrorHandler::warn("collateral not found: $collateralIdent"); - return ''; - } - - unless ($collateral->isImage()) { - WebGUI::ErrorHandler::warn("Bad image type: $collateralIdent"); - return ''; - } - - if ($width || $height) { - $url = scaleImage( - collateral => $collateral, - width => $width, - height => $height - ); - } - else { - WebGUI::ErrorHandler::warn("width or heigth must be specified"); - } - - $url ||= $collateral->getURL; - - return qq!!; -} - -#------------------------------------------------------------------- -sub scaleImage { - my (%p) = @_; - - my ($collateral,$width,$height) = @p{qw(collateral width height)}; - - # paranoia - return undef unless ($height || $width); - - my $filename = "SIThumb_".($width || 'r')."x".($height || 'r')."_".$collateral->getFilename(); - $filename .= '.png' if (isIn($collateral->getType(), qw(tif tiff bmp))); - - my $pathName = $collateral->{_node}->getPath().$session{os}{slash}.$filename; - unless (-e $pathName) { - my $image = _getImage($collateral); - return undef unless $image; - my ($newWidth,$newHeight); - - if ($width && $height) { - ($newWidth,$newHeight) = ($width,$height); - } - else { - my ($x, $y) = $image->Get('width','height'); - my $ratio = $x / $y; - $newWidth = $width ? $width : $height * $ratio; - $newHeight = $height ? $height : $width / $ratio; - } - - my $max = $session{setting}{maxImageSize}; - if ($newHeight > $max || $newWidth > $max) { - WebGUI::ErrorHandler::warn( - "Image too large ($newWidth,$newHeight) :".$collateral->get('name') - ); - return undef; - } - - $image->Scale(width => $newWidth, height => $newHeight); - if (my $error = $image->Write($pathName)) { - WebGUI::ErrorHandler::warn("Couldn't resize image: ".$error); - } - } - - return $collateral->{_node}->getURL."/$filename"; -} - -1; - -