Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge commit 'v7.10.23' into WebGUI8. Tests need fixing.
  • Loading branch information
perlDreamer committed Nov 2, 2011
2 parents 3b9f7ae + d84dd42 commit a2a8218
Show file tree
Hide file tree
Showing 72 changed files with 578 additions and 132 deletions.
17 changes: 16 additions & 1 deletion docs/changelog/7.x.x.txt
@@ -1,5 +1,20 @@
7.10.23
- fixed #12225: Stock asset, multiple instances on a page
- fixed #12229: Indexed thingy data has gateway url prepended to it
- fixed #12195: Visitor group by scratch membership shared among all Visitors (Dale Trexel)
- fixed #12227: Corrected AssetReport such that OrderBy works correctly.
- fixed #12238: Old template attachement in search template slows down sites
- fixed #12239: Still get cart error message after removing extra recurring items from the cart
- fixed #12240: Empty Extend Calendar Recurrance version tags
- fixed #12241: Account Shop
- fixed #12246: Layout inherits mobileStyleTemplateId and mobileTemplateId from parent Layouts
- fixed #12246: added extra_www_add_properties as properties fix-up hook in child for www_add
- fixed #12231: Thingy reindex fails on upgrade
- fixed #12245: Encrypt Login and Display Message on Login conflict
- fixed #12211: Recurring Item error message in Cart

7.10.22
- rfe #12223: Add dateTime type to content profiling (metadata)
- rfe #12223: Add date type to content profiling (metadata)
- rfe #12207: Thingy. Field_name info returned by www_editThingDataSaveViaAjax
- fixed #12206: Bad Subscription Groups in Duplicated Threads
- fixed #12208: replacements don't work
Expand Down
6 changes: 6 additions & 0 deletions docs/gotcha.txt
Expand Up @@ -31,6 +31,12 @@ save you many hours of grief.
Account Macro template
Admin Toggle Macro template

7.10.23
--------------------------------------------------------------------
* The default_search2 template had a bad template attachment pointing to
an old WebGUI CSS Snippet called /webgui.css. Any attachment with that
URL will be removed from ALL templates in the Search namespace.

7.10.21
--------------------------------------------------------------------
* WebGUI now depends on Kwargs.
Expand Down
2 changes: 1 addition & 1 deletion docs/legal.txt
Expand Up @@ -2,7 +2,7 @@
# WebGUI Legal Information #
####################################################################

WebGUI is Copyright 2001-2009 Plain Black Corporation. All rights
WebGUI is Copyright 2001-2011 Plain Black Corporation. All rights
reserved.

WebGUI Content Engine, WebGUI Runtime Environment, and Plain Black
Expand Down
Binary file not shown.
Binary file not shown.
141 changes: 141 additions & 0 deletions docs/upgrades/upgrade_7.10.22-7.10.23.pl
@@ -0,0 +1,141 @@
#!/usr/bin/env perl

#-------------------------------------------------------------------
# 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
#-------------------------------------------------------------------

our ($webguiRoot);

BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}

use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;


my $toVersion = '7.10.23';
my $quiet; # this line required


my $session = start(); # this line required

# upgrade functions go here
fixBadTemplateAttachments($session);

finish($session); # this line required


#----------------------------------------------------------------------------
# Describe what our function does
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
# # and here's our code
# print "DONE!\n" unless $quiet;
#}

#----------------------------------------------------------------------------
sub fixBadTemplateAttachments {
my $session = shift;
print "\tRemove template attachements in search templates that refer to an old, deleted CSS snippet... " unless $quiet;
# and here's our code
use WebGUI::Asset::Template;
my $get_template = WebGUI::Asset::Template->getIsa($session);
TEMPLATE: while (1) {
my $template = eval {$get_template->()};
next TEMPLATE if Exception::Class->caught;
last TEMPLATE unless $template;
next TEMPLATE unless $template->get('namespace') eq 'Search';
$template->removeAttachments(['^/(webgui.css);']);
}
print "DONE!\n" unless $quiet;
}


# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------

#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;

print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );

# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};

if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}

return;
}

#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}

#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}

#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}

#vim:ft=perl
1 change: 1 addition & 0 deletions etc/WebGUI.conf.original
Expand Up @@ -872,6 +872,7 @@
"r" : "r_printable",
"Spacer" : "Spacer",
"SpectreCheck" : "SpectreCheck",
"TwitterLogin" : "TwitterLogin",
"Thumbnail" : "Thumbnail",
"TwitterLogin" : "TwitterLogin",
"User" : "User",
Expand Down
31 changes: 23 additions & 8 deletions lib/WebGUI/Asset.pm
Expand Up @@ -1427,6 +1427,28 @@ sub getImportNode {
return WebGUI::Asset->newById($session, "PBasset000000000000002");
}

#-------------------------------------------------------------------

=head2 getInheritableProperties ( )
Returns a hash (list) of properties that should be inherited from a parent when creating an asset.
=cut

sub getInheritableProperties {
my $self = shift;
return (
parentId => $self->getId,
groupIdView => $self->get("groupIdView"),
groupIdEdit => $self->get("groupIdEdit"),
ownerUserId => $self->get("ownerUserId"),
encryptPage => $self->get("encryptPage"),
styleTemplateId => $self->get("styleTemplateId"),
printableStyleTemplateId => $self->get("printableStyleTemplateId"),
isHidden => $self->get("isHidden"),
);
}



#-------------------------------------------------------------------
Expand Down Expand Up @@ -2749,15 +2771,8 @@ sub www_add {
}
my %properties = (
%prototypeProperties,
parentId => $self->getId,
groupIdView => $self->get("groupIdView"),
groupIdEdit => $self->get("groupIdEdit"),
ownerUserId => $self->get("ownerUserId"),
encryptPage => $self->get("encryptPage"),
styleTemplateId => $self->get("styleTemplateId"),
printableStyleTemplateId => $self->get("printableStyleTemplateId"),
isHidden => $self->get("isHidden"),
className=>$class,
$self->getInheritableProperties,
assetId=>"new",
url=>scalar($self->session->form->param("url")),
);
Expand Down
4 changes: 2 additions & 2 deletions lib/WebGUI/Asset/Template.pm
Expand Up @@ -637,15 +637,15 @@ sub prepare {

$style->setRawHeadTags($headBlock);

my %props = ( type => 'text/css', rel => 'stylesheet' );
foreach my $sheet ( @{ $self->getAttachments('stylesheet') } ) {
my %props = ( type => 'text/css', rel => 'stylesheet' );
$style->setLink($sheet->{url}, \%props);
}

my $doScripts = sub {
my ($type, $body) = @_;
my %props = ( type => 'text/javascript' );
foreach my $script ( @{ $self->getAttachments($type) } ) {
my %props = ( type => 'text/javascript' );
$style->setScript($script->{url}, \%props, $body);
}
};
Expand Down
15 changes: 15 additions & 0 deletions lib/WebGUI/Asset/Wobject.pm
Expand Up @@ -226,6 +226,21 @@ sub getCollateral {
}


#-------------------------------------------------------------------

=head2 getInheritableProperties ( )
Extend the base class to include the mobileStyleTemplateId.
=cut

override getInheritableProperties => sub {
my $self = shift;
my %properties = super();
$properties{mobileStyleTemplateId} = $self->mobileStyleTemplateId;
return %properties;
};

#-------------------------------------------------------------------

=head2 getStyleTemplateId
Expand Down
5 changes: 2 additions & 3 deletions lib/WebGUI/Asset/Wobject/AssetReport.pm
Expand Up @@ -139,9 +139,8 @@ sub getTemplateVars {
$rules->{'whereClause'} .= qq{$prop $op $value};
}

if($rules->{'whereClause'}) {
$rules->{'joinClass'} = $settings->{className};
}
# Always join to the class, asset and assetData are excluded by getLineageSql
$rules->{'joinClass'} = $settings->{className};

#Build the order by condition
my $order = $settings->{order};
Expand Down
2 changes: 1 addition & 1 deletion lib/WebGUI/Asset/Wobject/Collaboration.pm
Expand Up @@ -1383,7 +1383,7 @@ around groupIdView => sub {
my $instance_data = {
workflowId => 'xR-_GRRbjBojgLsFx3dEMA',
className => 'WebGUI::Asset',
methodName => 'newById',
methodName => 'newPending',
parameters => $self->getId,
};
my $instance = WebGUI::Workflow::Instance->create($self->session, $instance_data);
Expand Down
16 changes: 15 additions & 1 deletion lib/WebGUI/Asset/Wobject/Layout.pm
Expand Up @@ -393,6 +393,21 @@ sub getContentLastModifiedBy {

#-------------------------------------------------------------------

=head2 getInheritableProperties ( )
Extend the base class to include the mobileTemplateId.
=cut

override getInheritableProperties => sub {
my $self = shift;
my %properties = super();
$properties{mobileTemplateId} = $self->mobileTemplateId;
return %properties;
};

#-------------------------------------------------------------------

=head2 www_view
Extend the base method to handle caching and ad rotation.
Expand Down Expand Up @@ -437,4 +452,3 @@ override www_view => sub {

__PACKAGE__->meta->make_immutable;
1;

6 changes: 3 additions & 3 deletions lib/WebGUI/Asset/Wobject/Thingy.pm
Expand Up @@ -1056,7 +1056,7 @@ sub getFieldValue {
# TODO: The otherThing field type is probably also handled by getFormPlugin, so the elsif below can probably be
# safely removed. However, this requires more testing than I can provide right now, so for now this stays the
# way it was.
elsif ($field->{fieldType} =~ m/^otherthing/x) {
elsif ($fieldType =~ m/^otherthing/x) {
my $otherThingId = $field->{fieldType};
$otherThingId =~ s/^otherThing_//x;
my $tableName = 'Thingy_'.$otherThingId;
Expand Down Expand Up @@ -1603,11 +1603,11 @@ sub indexThing {
return unless $thing;
my $index = WebGUI::Search::Index->new($self);
$index->addRecord(
url => $self->getUrl($self->getThingUrl($thing)),
groupIdView => $thing->{groupIdView},
title => $thing->{label},
subId => $thing->{thingId},
keywords => join(' ', @{$thing}{qw/label editScreenTitle editInstructions searchScreenTitle searchDescription/}),
url => $self->session->url->append($self->get('url'), $self->getThingUrl($thing)),
);
##Easy update of all thingData fields for this thing. This is in lieu of deleting all records
##And rebuilding them all.
Expand Down Expand Up @@ -1679,7 +1679,7 @@ sub indexThingData {
|| $self->getTitle;
$index->addRecord(
assetId => $self->getId,
url => $self->getUrl('func=viewThingData;thingId='. $thing->{thingId} . ';thingDataId='. $thingData->{thingDataId}),
url => $session->url->append($self->get('url'), 'func=viewThingData;thingId='. $thing->{thingId} . ';thingDataId='. $thingData->{thingDataId}),
groupIdView => $thing->{groupIdView},
title => $title,
subId => $thing->{thingId} . '-' . $thingData->{thingDataId},
Expand Down
3 changes: 1 addition & 2 deletions lib/WebGUI/AssetMetaData.pm
Expand Up @@ -15,7 +15,6 @@ package WebGUI::Asset;
=cut

use strict;
use Tie::IxHash;

=head1 NAME
Expand Down Expand Up @@ -380,7 +379,7 @@ sub www_editMetaDataField {
label=>$i18n->get(486),
hoverHelp=>$i18n->get('Data Type description'),
value=>$fieldInfo->{fieldType} || "text",
types=> [ qw /text integer yesNo selectBox radioList checkList dateTime/ ]
types=> [ qw /text integer yesNo selectBox radioList checkList date/ ]
);

my $default = ref WebGUI::Asset->assetName eq 'ARRAY'
Expand Down

0 comments on commit a2a8218

Please sign in to comment.