From d3893aec7519986b7410c7b1ded1a64bad369150 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Fri, 27 Aug 2010 12:44:46 -0500 Subject: [PATCH 01/15] POD for macro transform --- lib/WebGUI/Macro.pm | 48 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/lib/WebGUI/Macro.pm b/lib/WebGUI/Macro.pm index 26971ed71..6f5811f50 100644 --- a/lib/WebGUI/Macro.pm +++ b/lib/WebGUI/Macro.pm @@ -225,6 +225,54 @@ sub _processParameters { return \@params; } +=head2 transform ( $session, \$content, $sub ) + +Transforms the macro calls in $content accoring to $sub. For each macro call found, $sub will be called with a hash of information about the call. The return value of the sub should be either undef to leave the macro call untouched, or a string to replace the macro call with. Macros are not processed recursively. If recursive processing is needed, trannsform can be called again inside $sub. + +=head3 $session + +The WebGUI session to use. + +=head3 \$content + +A reference to a string to transform macros in. The string will be modified in place. + +=head3 $sub + +A sub reference to call for each macro call. + +The hash passed to $sub will contain: + +=over 4 + +=item session + +The session passed in. + +=item macro + +The name of the macro called. + +=item macroPackage + +The module name for the macro from the config file. + +=item originalText + +The full original text of the macro call. + +=item parameters + +An array reference to the parameters passed to the macro. + +=item parameterString + +The full original text of the parameters. + +=back + +=cut + sub transform { my $session = shift; my $content = shift; From 1fd17ef320f1eb107881eb95783a5508c1ff0aab Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Fri, 27 Aug 2010 13:20:30 -0500 Subject: [PATCH 02/15] add test for WebGUI::Macro::transform --- lib/WebGUI/Macro.pm | 4 ++-- t/Macro.t | 30 ++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/lib/WebGUI/Macro.pm b/lib/WebGUI/Macro.pm index 6f5811f50..3ef455fcd 100644 --- a/lib/WebGUI/Macro.pm +++ b/lib/WebGUI/Macro.pm @@ -257,7 +257,7 @@ The name of the macro called. The module name for the macro from the config file. -=item originalText +=item originalString The full original text of the macro call. @@ -299,7 +299,7 @@ sub _transformMacro { session => $session, macro => $macro, macroPackage => $macroPackage, - originalText => $original, + originalString => $original, parameters => $params, parameterString => $paramString, }); diff --git a/t/Macro.t b/t/Macro.t index 230d083c5..3a4eaa8f7 100644 --- a/t/Macro.t +++ b/t/Macro.t @@ -43,8 +43,6 @@ foreach my $macro (qw/ } $session->config->addToHash('macros', "Ex'tras", "Extras"); -plan tests => 51; - my $macroText = "CompanyName: ^c;"; my $companyName = $session->setting->get('companyName'); WebGUI::HTML::makeParameterSafe( \$companyName ); @@ -337,3 +335,31 @@ is ( '@MacroCall[`1`.` 2`.`3`]:', 'internal spaces are okay' ); + +my $macroText = 'before ^VisualMacro("1", 2,); after'; +my $macroData; +WebGUI::Macro::transform($session, \$macroText, sub { + $macroData = shift; + return "replace"; +}); + +is ( + $macroText, + 'before replace after', + 'transform replaces macro calls' +); + +is_deeply($macroData, { + session => $session, + macro => 'VisualMacro', + macroPackage => 'WebGUI::Macro::VisualMacro', + originalString => '^VisualMacro("1", 2,);', + parameters => [ + '1', + ' 2', + ], + parameterString => '("1", 2,)', +}, 'transform passes sub correct data'); + +done_testing; + From f4d964bd69a3deedba418d7e184c0e3155012289 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 27 Aug 2010 10:42:27 -0700 Subject: [PATCH 03/15] Remove getEditTabs completely --- lib/WebGUI/Asset/EMSSubmission.pm | 18 ------------------ lib/WebGUI/Asset/Sku.pm | 15 --------------- lib/WebGUI/Asset/Wobject/Calendar.pm | 14 -------------- lib/WebGUI/Asset/Wobject/Collaboration.pm | 15 --------------- lib/WebGUI/Asset/Wobject/DataTable.pm | 15 --------------- lib/WebGUI/Role/Asset/RssFeed.pm | 19 ------------------- 6 files changed, 96 deletions(-) diff --git a/lib/WebGUI/Asset/EMSSubmission.pm b/lib/WebGUI/Asset/EMSSubmission.pm index ba225361a..2145529ee 100644 --- a/lib/WebGUI/Asset/EMSSubmission.pm +++ b/lib/WebGUI/Asset/EMSSubmission.pm @@ -478,24 +478,6 @@ sub www_view { $_[0]->ems->www_viewSubmissionQueue } #------------------------------------------------------------------- -=head2 getEditTabs ( ) - -defines 2 new tabs. -the shop tab is created here to mimic the function of the sku-created -shop tab. this class holds data like Sku assets so that they can be assigned -in the future when the sku asset is created from this data. - - -override getEditTabs => sub { - my $self = shift; - my $sku_i18n = WebGUI::International->new($self->session,"Asset_Sku"); - return (super(), ['shop', $sku_i18n->get('shop'), 9],); -}; - -=cut - -#------------------------------------------------------------------- - =head2 getQueueUrl returns the URL for the submission queue page with the submisison id in the hash part diff --git a/lib/WebGUI/Asset/Sku.pm b/lib/WebGUI/Asset/Sku.pm index b6227ed40..64e9924a4 100644 --- a/lib/WebGUI/Asset/Sku.pm +++ b/lib/WebGUI/Asset/Sku.pm @@ -214,21 +214,6 @@ override getEditForm => sub { #------------------------------------------------------------------- -=head2 getEditTabs ( ) - -Not to be modified, just defines a new tab. - - -override getEditTabs => sub { - my $self = shift; - my $i18n = WebGUI::International->new($self->session,"Asset_Sku"); - return (super(), ['shop', $i18n->get('shop'), 9]); -}; - -=cut - -#------------------------------------------------------------------- - =head2 getOptions ( ) Returns a hash reference of configuration data that can return this sku to a configured state. See also applyOptions(). diff --git a/lib/WebGUI/Asset/Wobject/Calendar.pm b/lib/WebGUI/Asset/Wobject/Calendar.pm index a69ee1cb4..c8dfe7897 100644 --- a/lib/WebGUI/Asset/Wobject/Calendar.pm +++ b/lib/WebGUI/Asset/Wobject/Calendar.pm @@ -534,20 +534,6 @@ sub deleteFeed { #---------------------------------------------------------------------------- -=head2 getEditTabs ( ) - -Add the feeds tab to the edit form - -=cut - -sub getEditTabs { - my ( $self ) = @_; - my $i18n = WebGUI::International->new($self->session,"Asset_Calendar"); - return $self->SUPER::getEditTabs, ["feeds",$i18n->get("feeds"), 6]; -} - -#---------------------------------------------------------------------------- - =head2 getEvent ( assetId ) Gets an Event object from the database. Returns a WebGUI::Asset::Event object diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 70f806ff3..01200f29d 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -978,21 +978,6 @@ sub duplicateBranch { #------------------------------------------------------------------- -=head2 getEditTabs - -Add a tab for the mail interface. - - -sub getEditTabs { - my $self = shift; - my $i18n = WebGUI::International->new($self->session,"Asset_Collaboration"); - return ($self->next::method, ['mail', $i18n->get('mail'), 9]); -} - -=cut - -#------------------------------------------------------------------- - =head2 getNewThreadUrl( ) Formats the url to start a new thread. diff --git a/lib/WebGUI/Asset/Wobject/DataTable.pm b/lib/WebGUI/Asset/Wobject/DataTable.pm index 328d16204..1e1adb9db 100644 --- a/lib/WebGUI/Asset/Wobject/DataTable.pm +++ b/lib/WebGUI/Asset/Wobject/DataTable.pm @@ -141,21 +141,6 @@ sub getDateFormat { #---------------------------------------------------------------------------- -=head2 getEditTabs ( ) - -Add a tab for the data table. - -=cut - -sub getEditTabs { - my $self = shift; - my $i18n = WebGUI::International->new( $self->session, "Asset_DataTable" ); - - return ( $self->SUPER::getEditTabs, [ "data" => $i18n->get("tab label data") ], ); -} - -#---------------------------------------------------------------------------- - =head2 getTemplateVars ( ) Get the template vars for this asset. diff --git a/lib/WebGUI/Role/Asset/RssFeed.pm b/lib/WebGUI/Role/Asset/RssFeed.pm index f07000ce8..00d495091 100644 --- a/lib/WebGUI/Role/Asset/RssFeed.pm +++ b/lib/WebGUI/Role/Asset/RssFeed.pm @@ -593,23 +593,4 @@ sub www_viewRss { return $self->getFeed( XML::FeedPP::RSS->new )->to_string; } -#------------------------------------------------------------------- - -=head2 getEditTabs () - -Adds an RSS tab to the Edit Tabs. - - -around getEditTabs => sub { - my $orig = shift; - my $self = shift; - my $tabs = $self->$orig(@_); - my $i18n = WebGUI::International->new($self->session,'AssetAspect_RssFeed'); - push @{ $tabs }, ['rss', $i18n->get('RSS tab'), 1]; - return $tabs; -}; - -=cut - 1; - From a2760b296791636bc8f82c98d350f1b501baffe1 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sat, 28 Aug 2010 15:21:09 -0700 Subject: [PATCH 04/15] Add missing POD for get_all_settable_list in Definition::Meta::Class --- lib/WebGUI/Definition/Meta/Class.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/WebGUI/Definition/Meta/Class.pm b/lib/WebGUI/Definition/Meta/Class.pm index b0225db1f..0cf7d39f9 100644 --- a/lib/WebGUI/Definition/Meta/Class.pm +++ b/lib/WebGUI/Definition/Meta/Class.pm @@ -148,6 +148,15 @@ sub get_all_property_list { return @names; } +#------------------------------------------------------------------- + +=head2 get_all_settable_list ( ) + +Returns an array of the names of all Properties, in all classes, in the order they were +created in the Definition, that have the WebGUI::Definition::Meta::Settable role applied. + +=cut + sub get_all_settable_list { my $self = shift; my @names = (); From d700350ed1981fdb89ccd52ffc9fc83657446958 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 31 Aug 2010 15:52:53 -0500 Subject: [PATCH 05/15] fix upgrade skeleton --- share/upgrades/_upgrade.skeleton | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/share/upgrades/_upgrade.skeleton b/share/upgrades/_upgrade.skeleton index c6f0bee7a..a48f51bf5 100644 --- a/share/upgrades/_upgrade.skeleton +++ b/share/upgrades/_upgrade.skeleton @@ -1,8 +1,6 @@ use WebGUI::Upgrade::Script; -report "\tRunning an upgrade step..."; - -# if (! quiet) { ... } +start_step "Running an upgrade step"; # clear_cache; From 6bdeeacd50d864e195aabc1595b60ded6a1e45c6 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 31 Aug 2010 15:54:32 -0500 Subject: [PATCH 06/15] don't require WEBGUI_UPGRADE_VERSION if we can detect it from the dir directory --- lib/WebGUI/Upgrade/Script.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Upgrade/Script.pm b/lib/WebGUI/Upgrade/Script.pm index 49ffc40e3..19810e71c 100644 --- a/lib/WebGUI/Upgrade/Script.pm +++ b/lib/WebGUI/Upgrade/Script.pm @@ -41,11 +41,17 @@ my @cleanups; sub _build_exports { my $configFile = $ENV{WEBGUI_CONFIG} or die 'WEBGUI_CONFIG environment variable must be specified'; - my $version = $ENV{WEBGUI_UPGRADE_VERSION} - or die 'WEBGUI_UPGRADE_VERSION must be set'; + my $version = $ENV{WEBGUI_UPGRADE_VERSION}; my $upgrade_file = $caller_upgrade_file; (my $vol, my $dir, my $shortname) = File::Spec->splitpath( $upgrade_file ); $shortname =~ s/\.[^.]*$//; + my $last_dir = (File::Spec->splitdir($dir))[-1]; + if ( !$version && $last_dir =~ /\A\d+\.\d+\.\d+-(\d+\.\d+\.\d+)\z/msx ) { + $version = $1; + } + if (! $version) { + die 'WEBGUI_UPGRADE_VERSION must be set'; + } # need to be able to reference these directly in the cleanup code my $session; From 3570b413d32fbc234c7d72e064592d51814712e8 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 31 Aug 2010 15:26:21 -0500 Subject: [PATCH 07/15] remove WebGUI::PseudoRequest --- t/Session/Http.t | 1 - t/lib/WebGUI/PseudoRequest.pm | 441 -------------------------- t/lib/WebGUI/PseudoRequest/Headers.pm | 67 ---- t/lib/WebGUI/PseudoRequest/Upload.pm | 119 ------- t/lib/WebGUI/Test.pm | 1 - 5 files changed, 629 deletions(-) delete mode 100644 t/lib/WebGUI/PseudoRequest.pm delete mode 100644 t/lib/WebGUI/PseudoRequest/Headers.pm delete mode 100644 t/lib/WebGUI/PseudoRequest/Upload.pm diff --git a/t/Session/Http.t b/t/Session/Http.t index be6e425bd..3156e0fb5 100644 --- a/t/Session/Http.t +++ b/t/Session/Http.t @@ -13,7 +13,6 @@ use strict; use lib "$FindBin::Bin/../lib"; use WebGUI::Test; -use WebGUI::PseudoRequest; use WebGUI::Session; use HTML::TokeParser; use DateTime; diff --git a/t/lib/WebGUI/PseudoRequest.pm b/t/lib/WebGUI/PseudoRequest.pm deleted file mode 100644 index c1f293c70..000000000 --- a/t/lib/WebGUI/PseudoRequest.pm +++ /dev/null @@ -1,441 +0,0 @@ -package WebGUI::PseudoRequest; - -=head1 LEGAL - - ------------------------------------------------------------------- - WebGUI is Copyright 2001-2009 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 - ------------------------------------------------------------------- - -=cut - -use strict; - -use Test::MockObject; - -BEGIN { - Test::MockObject->fake_module( - 'Apache2::Cookie', - new => sub { - my $class = shift; - my $self = Test::MockObject->new; - $self->set_isa($class); - $self->set_true(qw(expires domain bake)); - }, - ); - - Test::MockObject->fake_module('APR::Request::Apache2', - handle => sub { - return $_[1]; - }, - ); -} - -use WebGUI::PseudoRequest::Headers; -use WebGUI::PseudoRequest::Upload; - -=head1 NAME - -Package WebGUI::PseudoRequest - -=head1 DESCRIPTION - -This is an almost complete imitation of Apache2::Request. You can use this package to -create a request object that will work with WebGUI, without actually being inside -the mod_perl environment. - -Why in the world would you want to do this? Well, when doing API testing sometimes -you run across things that require a request object, but you don't really want to -fire up Apache in order to do it. This will let you bypass that. - -=head2 new - -Construct a new PseudoRequest object. Creates a new Headers object as well and places -it inside the PseudoRequest object. - -=cut - -sub new { - my $this = shift; - my $class = ref($this) || $this; - my $headers = WebGUI::PseudoRequest::Headers->new(); - my $self = { headers_out => $headers, headers_in => {} }; - bless $self, $class; - return $self; -} - -#---------------------------------------------------------------------------- - -=head2 body ( [$value]) - -Compatibility method. Returns the requested form value, $value. If $value isn't passed in, returns -all form variables. - -=cut - - -sub body { - my $self = shift; - my $value = shift; - if ( !defined $value ) { - return if !$self->{body}; - return keys %{ $self->{body} } if wantarray; - return { %{ $self->{body} } }; - } - if ($self->{body}->{$value}) { - if (wantarray && ref $self->{body}->{$value} eq "ARRAY") { - return @{$self->{body}->{$value}}; - } - elsif (ref $self->{body}->{$value} eq "ARRAY") { - return $self->{body}->{$value}->[0]; - } - else { - return $self->{body}->{$value}; - } - } - else { - if (wantarray) { - return (); - } - else { - return undef; - } - } -} - -#---------------------------------------------------------------------------- - -=head2 setup_body ( $value ) - -Setup the object's body method so that it can be used. $value should be a hash ref of named -form variables and values. - -=cut - -sub setup_body { - my $self = shift; - my $value = shift; - $self->{body} = $value; -} - -#---------------------------------------------------------------------------- - -=head2 content_type ( [$value] ) - -Getter and setter for content_type. If $value is passed in, it will set the content_type of -the object to that. Returns the content_type stored in the object. - -=cut - -sub content_type { - my $self = shift; - my $value = shift; - if (defined $value) { - $self->{content_type} = $value; - } - return $self->{content_type}; -} - -#---------------------------------------------------------------------------- - -=head2 headers_in ( ) - -Mimics the behavior of Apache2::Request->headers_in. - -=cut - -sub headers_in { - my $self = shift; - return $self->{headers_in}; -} - -#---------------------------------------------------------------------------- - -=head2 headers_out ( ) - -Returns the PseudoRequst::Headers object stored in $self for access to the headers. - -=cut - -sub headers_out { - my $self = shift; - return $self->{headers_out}; ##return object for method chaining -} - -#---------------------------------------------------------------------------- - -=head2 no_cache ( [$value] ) - -Getter and setter for no_cache. If $value is passed in, it will set no_cache of -the object to that. Returns the no_cache value stored in the object. - -=cut - -sub no_cache { - my $self = shift; - my $value = shift; - if (defined $value) { - $self->{no_cache} = $value; - } - return $self->{no_cache}; -} - -#---------------------------------------------------------------------------- - -=head2 param ( [$value]) - -Compatibility method. Works exactly like the body method. - -=cut - -sub param { - my $self = shift; - $self->body(@_); -} - -#---------------------------------------------------------------------------- - -=head2 setup_param ( $value ) - -Setup the object's param method so that it can be used. $value should be a hash ref of named -form variables and values. - -=cut - -sub setup_param { - my $self = shift; - $self->setup_body(@_); -} - -#---------------------------------------------------------------------------- - -=head2 clear_output ( ) - -Clear the internally cached request output generated by calling the -C method. - -=cut - -sub clear_output { - my $self = shift; - $self->{output} = ''; -} - -#---------------------------------------------------------------------------- - -=head2 get_output ( ) - -Get the internally cached request output generated by calling the -C method. Returns it as a scalar. - -=cut - -sub get_output { - my $self = shift; - return $self->{output}; -} - -#---------------------------------------------------------------------------- - -=head2 method ( [ $method ] ) - -Getter/setter for the HTTP request method. - -=cut - -sub method { - my ($self, $newMethod) = @_; - my $method = $self->{method}; - if (defined $newMethod) { - $self->{method} = $newMethod; - } - return $method; -} - -#---------------------------------------------------------------------------- - -=head2 print ( @values ) - -Fake print method for the PseudoRequest object. It caches everything printed -to it by concatenating @values together, just like print would. Use clear_output -to clear the cached value, and get_output to access it. - -=cut - -sub print { - my $self = shift; - $self->{output} .= join '', @_; - return 1; -} - -#---------------------------------------------------------------------------- - -=head2 protocol ( $value ) - -Getter and setter for protocol. If $value is passed in, it will set the protocol of -the object to that. Returns the protocol value stored in the object. - -=cut - -sub protocol { - my $self = shift; - my $value = shift; - if (defined $value) { - $self->{protocol} = $value; - } - return $self->{protocol}; -} - -#---------------------------------------------------------------------------- - -=head2 status ( $value ) - -Getter and setter for status. If $value is passed in, it will set the status of -the object to that. Returns the status value stored in the object. - -=cut - -sub status { - my $self = shift; - my $value = shift; - if (defined $value) { - $self->{status} = $value; - } - return $self->{status}; -} - -#---------------------------------------------------------------------------- - -=head2 status_line ( $value ) - -Getter and setter for status_line. If $value is passed in, it will set the status_line of -the object to that. Returns the status_line value stored in the object. - -=cut - -sub status_line { - my $self = shift; - my $value = shift; - if (defined $value) { - $self->{status_line} = $value; - } - return $self->{status_line}; -} - -#---------------------------------------------------------------------------- - -=head2 upload ( $formName, [ $uploadFileHandler ] ) - -Getter and setter for upload objects, which are indexed in this object by $formName. -Returns what was stored in the slot referred to as $formName. If $formName is false, -it returns undef. - -=head3 $uploadFileHandle. - -$uploadFileHandle should be an array ref of WebGUI::PseudoRequest::Upload objects. If you -pass it $uploadFileHandle, it will set store the object under the name, $formName. - -=cut - -sub upload { - my $self = shift; - my $formName = shift; - my $uploadFileHandles = shift; - return unless $formName; - if (defined $uploadFileHandles) { - $self->{uploads}->{$formName} = $uploadFileHandles; - } - return @{ $self->{uploads}->{$formName} }; -} - -#---------------------------------------------------------------------------- - -=head2 uploadFiles ( $formName, $filesToUpload ) - -Convenience method for uploading several files at once into the PseudoRequest object, -all to be referenced off of $formName. If $formName is false, it returns undef. - -=head3 $fileToUpload - -$uploadFileHandle should be an array ref of complete paths to files. The method will -create one PseudoRequest::Upload object per file, then store the array ref -using the upload method. - -=cut - -sub uploadFiles { - my $self = shift; - my $formName = shift; - my $filesToUpload = shift; - return unless $formName; - return unless scalar $filesToUpload; - my @uploadObjects = (); - foreach my $file (@{ $filesToUpload }) { - my $upload = WebGUI::PseudoRequest::Upload->new($file); - push @uploadObjects, $upload; - } - $self->upload($formName, \@uploadObjects); -} - -#---------------------------------------------------------------------------- - -=head2 uri ( $value ) - -Getter and setter for uri. If $value is passed in, it will set the uri of -the object to that. Returns the uri value stored in the object. - -=cut - -sub uri { - my $self = shift; - my $value = shift; - if (defined $value) { - $self->{uri} = $value; - } - return $self->{uri}; -} - -#---------------------------------------------------------------------------- - -=head2 user ( $value ) - -Getter and setter for user. If $value is passed in, it will set the user of -the object to that. Returns the user value stored in the object. - -=cut - -sub user { - my $self = shift; - my $value = shift; - if (defined $value) { - $self->{user} = $value; - } - return $self->{user}; -} - -#---------------------------------------------------------------------------- - -=head2 jar ( $value ) - -Getter and setter for cookie jar. If $value is passed in, it will -set the cookie jar of the object to that. Returns the cookie jar -hash. - -=cut - -sub jar { - my $self = shift; - my $value = shift; - if (defined $value) { - $self->{jar} = $value; - } - return $self->{jar}; -} - -1; - diff --git a/t/lib/WebGUI/PseudoRequest/Headers.pm b/t/lib/WebGUI/PseudoRequest/Headers.pm deleted file mode 100644 index f6a68db92..000000000 --- a/t/lib/WebGUI/PseudoRequest/Headers.pm +++ /dev/null @@ -1,67 +0,0 @@ -package WebGUI::PseudoRequest::Headers; - -=head1 LEGAL - - ------------------------------------------------------------------- - WebGUI is Copyright 2001-2009 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 - ------------------------------------------------------------------- - -=cut - -use strict; - -=head1 NAME - -Package WebGUI::PseudoRequest::Headers - -=head2 new - -Construct a new PseudoRequest::Headers object. This is just for holding headers. -It doesn't do any magic. - -=cut - -sub new { - my $this = shift; - my $class = ref($this) || $this; - my $self = { headers => {} }; - bless $self, $class; - return $self; -} - -#---------------------------------------------------------------------------- - -=head2 set( $key, $value ) - -Set a key, value pair in the header object. - -=cut - -sub set { - my $self = shift; - my $key = shift; - my $value = shift; - $self->{headers}->{$key} = $value; -} - -#---------------------------------------------------------------------------- - -=head2 fetch - -Returns the entire internal hashref of headers. - -=cut - -sub fetch { - my $self = shift; - return $self->{headers}; -} - -1; - diff --git a/t/lib/WebGUI/PseudoRequest/Upload.pm b/t/lib/WebGUI/PseudoRequest/Upload.pm deleted file mode 100644 index 7a01d7f0b..000000000 --- a/t/lib/WebGUI/PseudoRequest/Upload.pm +++ /dev/null @@ -1,119 +0,0 @@ -package WebGUI::PseudoRequest::Upload; - -=head1 LEGAL - - ------------------------------------------------------------------- - WebGUI is Copyright 2001-2009 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 - ------------------------------------------------------------------- - -=cut - -use strict; -use File::Copy (); - -=head1 NAME - -Package WebGUI::PseudoRequest::Upload - -=head2 new ( [$file] ) - -Construct a new PseudoRequest::Upload object. This is just for holding headers. -It doesn't do any magic. - -=head3 $file - -The complete path to a file. If this is sent to new, it will go ahead and open -a filehandle to that file for you, saving you the need to call the fh, filename -and filesize methods. - -=cut - -sub new { - my $this = shift; - my $class = ref($this) || $this; - my $self = { - fh => undef, - size => 0, - filename => '', - output => '', - }; - my $file = shift; - if ($file and -e $file) { - $self->{filename} = $file; - $self->{size} = (stat $file)[7]; - open my $fh, '<' . $file or - die "Unable to open $file for reading and creating a filehandle: $!\n"; - $self->{fh} = $fh; - } - bless $self, $class; - return $self; -} - -#---------------------------------------------------------------------------- - -=head2 fh ( [$value] ) - -Getter and setter for fh. If $value is passed in, it will set the internal filehandle in -the object to that. Returns the filehandle stored in the object. - -=cut - -sub fh { - my $self = shift; - my $value = shift; - if (defined $value) { - $self->{fh} = $value; - } - return $self->{fh}; -} - -#---------------------------------------------------------------------------- - -=head2 filaname ( [$value] ) - -Getter and setter for filename. If $value is passed in, it will set the filename in -the object to that. Returns the filename in the object. - -=cut - -sub filename { - my $self = shift; - my $value = shift; - if (defined $value) { - $self->{filename} = $value; - } - return $self->{filename}; -} - -#---------------------------------------------------------------------------- - -=head2 size ( [$value] ) - -Getter and setter for size. If $value is passed in, it will set the internal size in -the object to that. Returns the size stored in the object. - -=cut - -sub size { - my $self = shift; - my $value = shift; - if (defined $value) { - $self->{size} = $value; - } - return $self->{size}; -} - -sub link { - my $self = shift; - my $dest = shift; - return File::Copy::copy($self->filename, $dest); -} - -1; - diff --git a/t/lib/WebGUI/Test.pm b/t/lib/WebGUI/Test.pm index 03a82a5ab..7430ca316 100644 --- a/t/lib/WebGUI/Test.pm +++ b/t/lib/WebGUI/Test.pm @@ -42,7 +42,6 @@ use List::MoreUtils qw(any); use File::Copy (); use File::Temp (); use Try::Tiny; -use WebGUI::PseudoRequest; use Scope::Guard; use Try::Tiny; use WebGUI::Paths -inc; From 12e744a189ca51fdd7a2807bdf6dcd02e6b1fca3 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 31 Aug 2010 15:50:51 -0500 Subject: [PATCH 08/15] moving WebGUI::Test to lib --- {t/lib => lib}/WebGUI/Test.pm | 42 +++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 14 deletions(-) rename {t/lib => lib}/WebGUI/Test.pm (96%) diff --git a/t/lib/WebGUI/Test.pm b/lib/WebGUI/Test.pm similarity index 96% rename from t/lib/WebGUI/Test.pm rename to lib/WebGUI/Test.pm index 7430ca316..dc264be5c 100644 --- a/t/lib/WebGUI/Test.pm +++ b/lib/WebGUI/Test.pm @@ -26,16 +26,14 @@ use strict; use warnings; use base qw(Test::Builder::Module); -use Log::Log4perl; -use Test::MockObject; -use Test::MockObject::Extends; use Log::Log4perl; # load early to ensure proper order of END blocks +use Test::MockObject::Extends; use Clone qw(clone); use File::Basename qw(dirname fileparse); -use File::Spec::Functions qw(abs2rel rel2abs catdir catfile updir); +use File::Spec::Functions qw(abs2rel rel2abs catdir catfile updir splitdir); use IO::Handle (); use IO::Select (); -use Cwd (); +use Cwd qw( realpath ); use Scalar::Util qw( blessed ); use Carp qw( carp croak ); use List::MoreUtils qw(any); @@ -47,20 +45,35 @@ use Try::Tiny; use WebGUI::Paths -inc; use namespace::clean; -our $WEBGUI_TEST_ROOT = rel2abs( catdir( dirname( __FILE__ ), (updir) x 2 ) ); - -our $WEBGUI_TEST_COLLATERAL = catdir( - $WEBGUI_TEST_ROOT, - 'supporting_collateral' -); - our @EXPORT = qw(cleanupGuard addToCleanup); our @EXPORT_OK = qw(session config collateral); my $CLASS = __PACKAGE__; +my $test_collateral; my $original_config_file; sub import { + my $test_dir = realpath( dirname( rel2abs( (caller 0)[1] ) ) ); + while ( 1 ) { + if ( (splitdir($test_dir))[-1] eq 't') { + my $lib_dir = catdir($test_dir, 'lib'); + if ( -d $lib_dir ) { + $test_collateral = catdir( + $test_dir, + 'supporting_collateral' + ); + + unshift @INC, $lib_dir; + } + last; + } + my $next_dir = realpath( catdir( $test_dir, updir ) ); + if ( $test_dir eq $next_dir ) { + last; + } + $test_dir = $next_dir; + } + if ( ! $original_config_file ) { my $config = $ENV{WEBGUI_CONFIG}; die "Enviroment variable WEBGUI_CONFIG must be set to the full path to a WebGUI config file.\n" @@ -394,7 +407,7 @@ Optionally adds a filename to the end. sub getTestCollateralPath { my $class = shift; my @path = @_; - return catfile(our $WEBGUI_TEST_COLLATERAL, @path); + return catfile($test_collateral, @path); } sub collateral { @@ -409,8 +422,9 @@ Returns the full path to the WebGUI lib directory, usually /data/WebGUI/lib. =cut +my $webgui_lib = realpath( catdir( dirname( __FILE__ ), (updir) x 3 ) ); sub lib { - return catdir( $WEBGUI_TEST_ROOT, updir, 'lib' ); + return $webgui_lib; } #---------------------------------------------------------------------------- From 8e00923aee5a1e207ccd6b296bf896c4b2112543 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 31 Aug 2010 15:53:58 -0500 Subject: [PATCH 09/15] don't preload WebGUI::Test --- lib/WebGUI/Paths.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/WebGUI/Paths.pm b/lib/WebGUI/Paths.pm index 7de1d2cb4..e693e9e16 100644 --- a/lib/WebGUI/Paths.pm +++ b/lib/WebGUI/Paths.pm @@ -204,6 +204,7 @@ sub preloadExclude { my $class = shift; my @excludes = _readTextLines($class->preloadExclusions); push @excludes, 'WebGUI::Upgrade', 'WebGUI::Upgrade::*'; + push @excludes, 'WebGUI::Test', 'WebGUI::Test::*'; return @excludes; } From 83f0cb7f6bcfa30bc50e80ad9861af2bb652aad9 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 31 Aug 2010 16:03:11 -0500 Subject: [PATCH 10/15] diag -> note --- t/Storage.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/Storage.t b/t/Storage.t index 0c37fa89e..e37d38a92 100644 --- a/t/Storage.t +++ b/t/Storage.t @@ -418,7 +418,7 @@ $tarStorage->addFileFromFilesystem(WebGUI::Test->getTestCollateralPath('extensio my $extensionStorage = $tarStorage->untar('extensions.tar'); WebGUI::Test->addToCleanup($extensionStorage); use Data::Dumper; -diag Dumper $extensionStorage->getFiles; +note Dumper $extensionStorage->getFiles; cmp_bag( $extensionStorage->getFiles, [ qw{ extension_pm.txt extension_perl.txt extension_html.txt extensions extensions/extension_html.txt }], From 91fcedd2e47302935a38144609ade86d71c7ce0b Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Mon, 30 Aug 2010 18:09:46 -0500 Subject: [PATCH 11/15] all admin plugins have the same response options --- www/extras/admin/admin.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/www/extras/admin/admin.js b/www/extras/admin/admin.js index 6a4ab7bbb..12751871e 100644 --- a/www/extras/admin/admin.js +++ b/www/extras/admin/admin.js @@ -531,7 +531,7 @@ WebGUI.Admin.prototype.requestHelper var callback = { success : function (o) { var resp = YAHOO.lang.JSON.parse( o.responseText ); - this.processHelper( resp ); + this.processPlugin( resp ); }, failure : function (o) { @@ -544,8 +544,8 @@ WebGUI.Admin.prototype.requestHelper }; /** - * processHelper( response ) - * Process the helper response. Possible responses include: + * processPlugin( response ) + * Process the plugin response. Possible responses include: * message : A message to the user * error : An error message * openDialog : Open a dialog with the given URL @@ -554,7 +554,7 @@ WebGUI.Admin.prototype.requestHelper * scriptFunc : Run a JS function. Used with scriptFile * scriptArgs : Arguments to scriptFunc. Used with scriptFile */ -WebGUI.Admin.prototype.processHelper +WebGUI.Admin.prototype.processPlugin = function ( resp ) { if ( resp.openTab ) { this.openTab( resp.openTab ); @@ -572,7 +572,7 @@ WebGUI.Admin.prototype.processHelper this.showInfoMessage( resp.error ); } else { - alert( "Unknown helper response: " + YAHOO.lang.JSON.stringify(resp) ); + alert( "Unknown plugin response: " + YAHOO.lang.JSON.stringify(resp) ); } }; From 2f949cf8ef2638865f16750c1e588439a279bb83 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Mon, 30 Aug 2010 19:26:09 -0500 Subject: [PATCH 12/15] admin console style should not define a title --- share/upgrades/7.9.12-8.0.0/admin_console.wgpkg | Bin 0 -> 1085 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 share/upgrades/7.9.12-8.0.0/admin_console.wgpkg diff --git a/share/upgrades/7.9.12-8.0.0/admin_console.wgpkg b/share/upgrades/7.9.12-8.0.0/admin_console.wgpkg new file mode 100644 index 0000000000000000000000000000000000000000..886184d579799f1d8fcb3039cc3856626cd96bc4 GIT binary patch literal 1085 zcmV-D1j73tiwFP!00000|Ls=abJ|7_=GlLRs;73QK@t*BsGAuZoSF=FXbg7Jka`a3 z3>S+#&E3hEcJjY>?@qsEXGgP>Kjz~%5)DkS2N+U;t!+7}H)OG5V;z~SK1htu~xrr*<+ z&e|(~17AP;^)G_$JML4?0En$1_-6fspy_Yb-)}b>H4E50{B@}M*AJiib42*(2!_xW zl5sT0w$-&heg0W5C7dOgOM-=3)n>{vB}4pxW3^^`wl-DEA;(DK=ya_&{Bk2kLY_S) zjKl7UhN5X47k*jbL3H+rmPxEL*fIcI4Vt90n1}_AO7MHUUNIhNSi4-Ncy&W)#8%qR zEjRF^}B6!VF|e4t(I$`LnEb;vSe$_-UoJ#Irr z1%pEt$45e7nIVo&B`~0;FaPoUc4`Bm?D3V*UiC;uQ~ULlPwBCa^|*|w_-z-8 z*XeYObKwA`)2>r_920tPaU6py0bU`K1;=;r@2@jeW%1)3dQcnngwB8Z6}A;Y%6JKl z?!Y1}IXl3_0(vz}rL`Xwb~S1Np^A6=fVj1QBIR5 z_zigTyVb@d(&&JFqF%XH&kPN8-MTtDS#MtxY{q(3JOC}+K5J{4e zQ{fI+OUJw8Z&H#PeLxAw`G^h95gzYQav>s5pzK^z1`*XtWpb-QZF{!1JYL#EWq z=<9}F5z)tYD2=lT-%K;FoQ~P)v^$+iX#?o#f<%uC zb*YFE1vSaiGy+pG+Y}+N%q_MB2-A?S6FJJep;B^?yzEUzFXWe-UN{J5L+|a!A^Kx} zO@foM#zb7L1r&O_Cv-RFOzzYN44FmrIeJ6R$01^NI DAtN0= literal 0 HcmV?d00001 From 945d78cb324a04963377e2f76cc1db2652dedb53 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Mon, 30 Aug 2010 19:39:59 -0500 Subject: [PATCH 13/15] add openTab function for admin plugins --- www/extras/admin/admin.css | 2 +- www/extras/admin/admin.js | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/www/extras/admin/admin.css b/www/extras/admin/admin.css index 7b3c37947..f5b5d9556 100644 --- a/www/extras/admin/admin.css +++ b/www/extras/admin/admin.css @@ -217,7 +217,7 @@ input.disabled { margin: 0; padding: 0; } -#viewTab iframe { +#tab_content_wrapper iframe { border: none; width: 100%; height: 100%; diff --git a/www/extras/admin/admin.js b/www/extras/admin/admin.js index 12751871e..29b4d81da 100644 --- a/www/extras/admin/admin.js +++ b/www/extras/admin/admin.js @@ -549,6 +549,7 @@ WebGUI.Admin.prototype.requestHelper * message : A message to the user * error : An error message * openDialog : Open a dialog with the given URL + * openTab : Open a tab with the given URL * redirect : Redirect the View pane to the given URL * scriptFile : Load a JS file * scriptFunc : Run a JS function. Used with scriptFile @@ -735,6 +736,41 @@ WebGUI.Admin.prototype.addHistoryHandler YAHOO.util.Event.on( elem, "click", function(){ self.gotoAsset( url ) }, self, true ); }; +/** + * openTab ( url ) + * Open a new tab with an iframe and the given URL + */ +WebGUI.Admin.prototype.openTab += function ( url ) { + // Prepare the iframe first + var iframe = document.createElement( 'iframe' ); + iframe.src = url; + YAHOO.util.Event.on( iframe, 'load', function(){ this.updateTabLabel(newTab); }, this, true ); + + // Prepare the tab + var newTab = new YAHOO.widget.Tab({ + label : "Loading...", + content : '' + }); + newTab.get('contentEl').appendChild( iframe ); + + // Fire when ready, Gridley + this.tabBar.addTab( newTab ); + +}; + +/** + * updateTabLabel( tab ) + * Update the tab's label with the title from the iframe inside + */ +WebGUI.Admin.prototype.updateTabLabel += function ( tab ) { + // Find the iframe + var iframe = tab.get('contentEl').getElementsByTagName( 'iframe' )[0]; + var title = iframe.contentDocument.title; + tab.set( 'label', title ); +}; + /**************************************************************************** * WebGUI.Admin.LocationBar */ From a18463a32a505ca9abd7c91b50c5fd6a03bb4434 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Tue, 31 Aug 2010 16:06:27 -0500 Subject: [PATCH 14/15] add helpers in the config file --- lib/WebGUI/Asset.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index dcdbc047f..66fac0278 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -1131,6 +1131,8 @@ Get the AssetHelpers for this asset. sub getHelpers { my ( $self ) = @_; + my $session = $self->session; + my ( $conf ) = $session->quick(qw{ config }); my $default = [ { @@ -1171,6 +1173,20 @@ sub getHelpers { }, ]; + + # Get additional helpers for this class from config + my $confHelpers = $conf->get('assets/' . $self->className . '/helpers'); + # Merge on label + for my $helper ( @$confHelpers ) { + WebGUI::Macro::process( \$helper->{label} ); + if ( my $replace = first { $_->{label} eq $helper->{label} } @$default ) { + $replace = $helper; # replace in the default arrayref + } + else { + push @$default, $helper; + } + } + return $default; } From d826721264aed31d703fb8c46cafa1121a1a236e Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 1 Sep 2010 11:15:58 -0500 Subject: [PATCH 15/15] move upgrade scripts for new version --- .../addI18nMacroAlias.pl | 0 .../addMaintenancePageToConfig.pl | 0 .../addNewAdminConsole.pl | 0 .../admin_progress_bar.wgpkg | Bin .../facebook_auth.sql | 0 .../migrateToNewCache.pl | 0 .../moveFileLocations.pl | 0 .../moveMaintenance.pl | 0 .../pbtmplblankstyle000001.wgpkg | Bin .../removeAdminBar.pl | 0 .../root_import_default-asset-subscription.wgpkg | Bin ...ot_import_default-facebook-choose-username.wgpkg | Bin .../root_import_richedit.wgpkg | Bin 13 files changed, 0 insertions(+), 0 deletions(-) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/addI18nMacroAlias.pl (100%) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/addMaintenancePageToConfig.pl (100%) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/addNewAdminConsole.pl (100%) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/admin_progress_bar.wgpkg (100%) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/facebook_auth.sql (100%) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/migrateToNewCache.pl (100%) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/moveFileLocations.pl (100%) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/moveMaintenance.pl (100%) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/pbtmplblankstyle000001.wgpkg (100%) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/removeAdminBar.pl (100%) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/root_import_default-asset-subscription.wgpkg (100%) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/root_import_default-facebook-choose-username.wgpkg (100%) rename share/upgrades/{7.9.12-8.0.0 => 7.9.13-8.0.0}/root_import_richedit.wgpkg (100%) diff --git a/share/upgrades/7.9.12-8.0.0/addI18nMacroAlias.pl b/share/upgrades/7.9.13-8.0.0/addI18nMacroAlias.pl similarity index 100% rename from share/upgrades/7.9.12-8.0.0/addI18nMacroAlias.pl rename to share/upgrades/7.9.13-8.0.0/addI18nMacroAlias.pl diff --git a/share/upgrades/7.9.12-8.0.0/addMaintenancePageToConfig.pl b/share/upgrades/7.9.13-8.0.0/addMaintenancePageToConfig.pl similarity index 100% rename from share/upgrades/7.9.12-8.0.0/addMaintenancePageToConfig.pl rename to share/upgrades/7.9.13-8.0.0/addMaintenancePageToConfig.pl diff --git a/share/upgrades/7.9.12-8.0.0/addNewAdminConsole.pl b/share/upgrades/7.9.13-8.0.0/addNewAdminConsole.pl similarity index 100% rename from share/upgrades/7.9.12-8.0.0/addNewAdminConsole.pl rename to share/upgrades/7.9.13-8.0.0/addNewAdminConsole.pl diff --git a/share/upgrades/7.9.12-8.0.0/admin_progress_bar.wgpkg b/share/upgrades/7.9.13-8.0.0/admin_progress_bar.wgpkg similarity index 100% rename from share/upgrades/7.9.12-8.0.0/admin_progress_bar.wgpkg rename to share/upgrades/7.9.13-8.0.0/admin_progress_bar.wgpkg diff --git a/share/upgrades/7.9.12-8.0.0/facebook_auth.sql b/share/upgrades/7.9.13-8.0.0/facebook_auth.sql similarity index 100% rename from share/upgrades/7.9.12-8.0.0/facebook_auth.sql rename to share/upgrades/7.9.13-8.0.0/facebook_auth.sql diff --git a/share/upgrades/7.9.12-8.0.0/migrateToNewCache.pl b/share/upgrades/7.9.13-8.0.0/migrateToNewCache.pl similarity index 100% rename from share/upgrades/7.9.12-8.0.0/migrateToNewCache.pl rename to share/upgrades/7.9.13-8.0.0/migrateToNewCache.pl diff --git a/share/upgrades/7.9.12-8.0.0/moveFileLocations.pl b/share/upgrades/7.9.13-8.0.0/moveFileLocations.pl similarity index 100% rename from share/upgrades/7.9.12-8.0.0/moveFileLocations.pl rename to share/upgrades/7.9.13-8.0.0/moveFileLocations.pl diff --git a/share/upgrades/7.9.12-8.0.0/moveMaintenance.pl b/share/upgrades/7.9.13-8.0.0/moveMaintenance.pl similarity index 100% rename from share/upgrades/7.9.12-8.0.0/moveMaintenance.pl rename to share/upgrades/7.9.13-8.0.0/moveMaintenance.pl diff --git a/share/upgrades/7.9.12-8.0.0/pbtmplblankstyle000001.wgpkg b/share/upgrades/7.9.13-8.0.0/pbtmplblankstyle000001.wgpkg similarity index 100% rename from share/upgrades/7.9.12-8.0.0/pbtmplblankstyle000001.wgpkg rename to share/upgrades/7.9.13-8.0.0/pbtmplblankstyle000001.wgpkg diff --git a/share/upgrades/7.9.12-8.0.0/removeAdminBar.pl b/share/upgrades/7.9.13-8.0.0/removeAdminBar.pl similarity index 100% rename from share/upgrades/7.9.12-8.0.0/removeAdminBar.pl rename to share/upgrades/7.9.13-8.0.0/removeAdminBar.pl diff --git a/share/upgrades/7.9.12-8.0.0/root_import_default-asset-subscription.wgpkg b/share/upgrades/7.9.13-8.0.0/root_import_default-asset-subscription.wgpkg similarity index 100% rename from share/upgrades/7.9.12-8.0.0/root_import_default-asset-subscription.wgpkg rename to share/upgrades/7.9.13-8.0.0/root_import_default-asset-subscription.wgpkg diff --git a/share/upgrades/7.9.12-8.0.0/root_import_default-facebook-choose-username.wgpkg b/share/upgrades/7.9.13-8.0.0/root_import_default-facebook-choose-username.wgpkg similarity index 100% rename from share/upgrades/7.9.12-8.0.0/root_import_default-facebook-choose-username.wgpkg rename to share/upgrades/7.9.13-8.0.0/root_import_default-facebook-choose-username.wgpkg diff --git a/share/upgrades/7.9.12-8.0.0/root_import_richedit.wgpkg b/share/upgrades/7.9.13-8.0.0/root_import_richedit.wgpkg similarity index 100% rename from share/upgrades/7.9.12-8.0.0/root_import_richedit.wgpkg rename to share/upgrades/7.9.13-8.0.0/root_import_richedit.wgpkg