fix 11770 Starter needs to set all account plugins

Refactored HomePage wizard to have a method to update
all places where the style template needs to be updated
This commit is contained in:
Doug Bell 2010-08-10 12:24:28 -05:00
parent 89c1afd10e
commit 994f0aa98c
3 changed files with 44 additions and 28 deletions

View file

@ -360,22 +360,9 @@ sub www_defaultStyleSave {
my ( $self, @args ) = @_;
my $output = WebGUI::Wizard::HomePage::www_pickStyleSave( $self, @args );
my $session = $self->session;
# update default site style
$session->setting->set( "userFunctionStyleId", $self->get('styleTemplateId') );
my $home = WebGUI::Asset->getDefault( $session );
my $assetIter = $home->getLineageIterator( [ "self", "descendants" ] );
while ( 1 ) {
my $asset;
eval { $asset = $assetIter->() };
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
$session->log->error($x->full_message);
next;
}
last unless $asset;
if ( defined $asset ) {
$asset->update( { styleTemplateId => $self->get("styleTemplateId") } );
}
}
my $home = WebGUI::Asset->getDefault( $session );
WebGUI::Wizard::HomePage::updateDefaultStyle( $self, $self->get('styleTemplateId'), $home );
return $output;
}