Remove the headblock property from the Template Asset, and merge

it into extra head tags.  Style templates are not allowed to
have extra head tags.
This commit is contained in:
Colin Kuskie 2008-11-26 21:24:44 +00:00
parent d3f8a075a7
commit 2b3b3fd458
7 changed files with 108 additions and 46 deletions

View file

@ -12,6 +12,7 @@
- fixed #4159: more menu doesn't appear for current asset on crumb trail
- fixed #9157: another typ-o in i18n
- fixed #9112: Thingy View Thing screen doesn't preserve newlines
- fixed #9155: purpose of "headblock" duplicates "extra head tags"
7.6.4
- Survey now will show progress and time limit.
@ -79,7 +80,6 @@
- fixed #9140: Date format error when adding tasks to PM
- fixed #8800: Errors in POD of Asset-related mix-in modules (Bernd Kalbfuß-Zimmermann)
- fixed #9143: Yes No user profile fields problem when default == 1
- fixed #9155: purpose of "headblock" duplicates "extra head tags"
7.5.34
- fixed: Regression with ProfileField->formField. Added tests to prevent future regression

View file

@ -10,8 +10,13 @@ save you many hours of grief.
7.6.5
--------------------------------------------------------------------
* The deprecated use of Graphics::Magick has been eliminated. WebGUI uses
Image::Magick exclusively for all image processing functions once again.
Image::Magick exclusively for all image processing functions once again.
* The Head Block of Templates has been merged into the Extra Head
Tags field. Extra Head Tags are now added for all templates and
assets included on a page, except for Style templates, which do
not have Extra Head Tags. Existing Extra Head Tags for Style
templates have been removed.
7.6.4
--------------------------------------------------------------------

View file

@ -20,6 +20,7 @@ use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
use WebGUI::Asset;
my $toVersion = "7.6.5"; # make this match what version you're going to
@ -27,12 +28,42 @@ my $quiet; # this line required
my $session = start(); # this line required
fixAccountMisspellings( $session );
fixAccountMisspellings( $session );
removeTemplateHeadBlock( $session );
# upgrade functions go here
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
sub removeTemplateHeadBlock {
my $session = shift;
print "\tMerging Template head blocks into the Extra Head Tags field... " unless $quiet;
my $sth = $session->db->prepare('select assetId, revisionDate, headBlock from template');
$sth->execute();
TMPL: while (my $templateData = $sth->hashRef) {
my $template = WebGUI::Asset->new($session,
$templateData->{assetId}, 'WebGUI::Asset::Template',
$templateData->{revisionDate},
);
next TMPL unless defined $template;
if ($template->get('namespace') eq 'style') {
$template->update({
extraHeadTags => '',
});
}
else {
$template->update({
extraHeadTags => $template->getExtraHeadTags . $templateData->{headBlock},
});
}
}
$session->db->write('ALTER TABLE template DROP COLUMN headBlock');
# and here's our code
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {