Snippets can now select a template parser

(instead of being restricted to the configured default)
This commit is contained in:
Paul Driver 2011-03-31 15:19:03 -05:00
parent 3ad6c4eb3a
commit 3531c4d913
8 changed files with 197 additions and 34 deletions

View file

@ -4,6 +4,8 @@
- fixed #12084: Greenportal links are sometimes white on white
- rfe #618: Syndicated Content Asset: Make images in the downloaded RSS-feeds available in the template.
- fixed #12086: Shop Billing Address Unpopulated
- Snippets can now select a template parser (instead of being restricted to
the configured default)
7.10.12
- fixed #12072: Product, related and accessory assets

View file

@ -32,6 +32,7 @@ my $session = start(); # this line required
# upgrade functions go here
addAutoPlayToCarousel( $session );
addProcessorDropdownToSnippet( $session );
finish($session); # this line required
@ -56,6 +57,36 @@ sub addAutoPlayToCarousel {
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub addProcessorDropdownToSnippet {
my $session = shift;
my $db = $session->db;
print "\tUpdating the Snippet table to add templateProcessor option..."
unless $quiet;
my $rows = $db->buildArrayRefOfHashRefs(q{
select assetId, revisionDate from snippet where processAsTemplate = 1
});
$db->write(q{
alter table snippet
drop column processAsTemplate,
add column templateParser char(255)
});
my $default = $session->config->get('defaultTemplateParser');
for my $row (@$rows) {
$db->write(q{
update snippet
set templateParser = ?
where assetId = ? and revisionDate = ?
}, [ $default, $row->{assetId}, $row->{revisionDate} ]);
}
print "Done!\n";
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------