Merge commit 'v7.10.15' into 8
Conflicts: docs/gotcha.txt docs/previousVersion.sql docs/templates.txt lib/WebGUI.pm lib/WebGUI/Asset.pm lib/WebGUI/Asset/Event.pm lib/WebGUI/Asset/File.pm lib/WebGUI/Asset/MapPoint.pm lib/WebGUI/Asset/RichEdit.pm lib/WebGUI/Asset/Sku/Product.pm lib/WebGUI/Asset/Snippet.pm lib/WebGUI/Asset/Story.pm lib/WebGUI/Asset/Template.pm lib/WebGUI/Asset/Template/TemplateToolkit.pm lib/WebGUI/Asset/Wobject/Calendar.pm lib/WebGUI/Asset/Wobject/Carousel.pm lib/WebGUI/Asset/Wobject/Collaboration.pm lib/WebGUI/Asset/Wobject/Dashboard.pm lib/WebGUI/Asset/Wobject/DataForm.pm lib/WebGUI/Asset/Wobject/Folder.pm lib/WebGUI/Asset/Wobject/Map.pm lib/WebGUI/Asset/Wobject/Search.pm lib/WebGUI/Asset/Wobject/Shelf.pm lib/WebGUI/Asset/Wobject/StockData.pm lib/WebGUI/Asset/Wobject/StoryTopic.pm lib/WebGUI/Asset/Wobject/SyndicatedContent.pm lib/WebGUI/Asset/Wobject/Thingy.pm lib/WebGUI/Asset/Wobject/WeatherData.pm lib/WebGUI/AssetClipboard.pm lib/WebGUI/AssetCollateral/DataForm/Entry.pm lib/WebGUI/AssetExportHtml.pm lib/WebGUI/AssetLineage.pm lib/WebGUI/AssetMetaData.pm lib/WebGUI/AssetTrash.pm lib/WebGUI/AssetVersioning.pm lib/WebGUI/Auth.pm lib/WebGUI/Cache/CHI.pm lib/WebGUI/Content/AssetManager.pm lib/WebGUI/Fork/ProgressBar.pm lib/WebGUI/Form/JsonTable.pm lib/WebGUI/Form/TimeField.pm lib/WebGUI/Form/Zipcode.pm lib/WebGUI/Group.pm lib/WebGUI/International.pm lib/WebGUI/Macro/AssetProxy.pm lib/WebGUI/Macro/FileUrl.pm lib/WebGUI/Operation/SSO.pm lib/WebGUI/Operation/User.pm lib/WebGUI/Role/Asset/Subscribable.pm lib/WebGUI/Shop/Cart.pm lib/WebGUI/Shop/Transaction.pm lib/WebGUI/Shop/TransactionItem.pm lib/WebGUI/Test.pm lib/WebGUI/URL/Content.pm lib/WebGUI/URL/Uploads.pm lib/WebGUI/User.pm lib/WebGUI/Workflow/Activity/ExtendCalendarRecurrences.pm lib/WebGUI/Workflow/Activity/SendNewsletters.pm lib/WebGUI/i18n/English/Asset.pm lib/WebGUI/i18n/English/WebGUI.pm sbin/installClass.pl sbin/rebuildLineage.pl sbin/search.pl sbin/testEnvironment.pl t/Asset/Asset.t t/Asset/AssetClipboard.t t/Asset/AssetLineage.t t/Asset/AssetMetaData.t t/Asset/Event.t t/Asset/File.t t/Asset/File/Image.t t/Asset/Post/notification.t t/Asset/Sku.t t/Asset/Story.t t/Asset/Template.t t/Asset/Wobject/Collaboration/templateVariables.t t/Asset/Wobject/Collaboration/unarchiveAll.t t/Asset/Wobject/Shelf.t t/Auth.t t/Macro/EditableToggle.t t/Macro/FilePump.t t/Shop/Cart.t t/Shop/Transaction.t t/Storage.t t/User.t t/Workflow.t
This commit is contained in:
commit
277faae8a1
783 changed files with 32041 additions and 25495 deletions
|
|
@ -23,7 +23,7 @@ BEGIN {
|
|||
|
||||
$|++; # disable output buffering
|
||||
|
||||
our ( $configFile, $help, $man, $fix, $delete );
|
||||
our ( $configFile, $help, $man, $fix, $delete, $no_progress );
|
||||
use Pod::Usage;
|
||||
use Getopt::Long;
|
||||
use WebGUI::Session;
|
||||
|
|
@ -35,6 +35,7 @@ GetOptions(
|
|||
'man' => \$man,
|
||||
'fix' => \$fix,
|
||||
'delete' => \$delete,
|
||||
'noProgress' => \$no_progress,
|
||||
);
|
||||
|
||||
pod2usage( verbose => 1 ) if $help;
|
||||
|
|
@ -65,11 +66,14 @@ my $totalAsset = $session->db->quickScalar('SELECT COUNT(*) FROM asset');
|
|||
my $totalAssetData = $session->db->quickScalar('SELECT COUNT( DISTINCT( assetId ) ) FROM assetData' );
|
||||
my $total = $totalAsset >= $totalAssetData ? $totalAsset : $totalAssetData;
|
||||
|
||||
# Order by to put corrupt parents before corrupt children
|
||||
# Order by lineage to put corrupt parents before corrupt children
|
||||
# Join assetData to get all asset and assetData
|
||||
my $sql = "SELECT * FROM asset LEFT JOIN assetData USING ( assetId ) GROUP BY assetId ORDER BY lineage ASC";
|
||||
my $sth = $session->db->read($sql);
|
||||
|
||||
##Guarantee that we get the most recent revisionDate
|
||||
my $max_revision = $session->db->prepare('select max(revisionDate) from assetData where assetId=?');
|
||||
|
||||
my $count = 1;
|
||||
my %classTables; # Cache definition lookups
|
||||
while ( my %row = $sth->hash ) {
|
||||
|
|
@ -85,6 +89,8 @@ while ( my %row = $sth->hash ) {
|
|||
eval "require $row{className}";
|
||||
[ map { $_->{tableName} } reverse @{ $row{className}->definition($session) } ];
|
||||
};
|
||||
$max_revision->execute([$row{assetId}]);
|
||||
($row{revisionDate}) = $max_revision->array();
|
||||
$row{revisionDate} ||= time;
|
||||
|
||||
for my $table ( @{$classTables} ) {
|
||||
|
|
@ -103,12 +109,15 @@ while ( my %row = $sth->hash ) {
|
|||
}
|
||||
print "Fixed.\n";
|
||||
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $row{assetId} );
|
||||
# Make sure we have a valid parent
|
||||
unless ( WebGUI::Asset->newByDynamicClass( $session, $row{parentId} ) ) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $row{assetId} );
|
||||
unless ( $asset && WebGUI::Asset->newByDynamicClass( $session, $row{parentId} ) ) {
|
||||
$asset->setParent( WebGUI::Asset->getImportNode( $session ) );
|
||||
print "\tNOTE: Invalid parent. Asset moved to Import Node\n";
|
||||
}
|
||||
if (!$asset) {
|
||||
print "\tWARNING. Asset is still broken.\n";
|
||||
}
|
||||
|
||||
} ## end if ($fix)
|
||||
elsif ($delete) {
|
||||
|
|
@ -191,8 +200,10 @@ while ( my %row = $sth->hash ) {
|
|||
} ## end else [ if ($fix) ]
|
||||
|
||||
} ## end if ( !$asset )
|
||||
progress( $total, $count++ );
|
||||
progress( $total, $count++ ) unless $no_progress;
|
||||
} ## end while ( my %row = $sth->hash)
|
||||
$sth->finish;
|
||||
$max_revision->finish;
|
||||
|
||||
finish($session);
|
||||
print "\n";
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ pod2usage() unless (defined($configFile) && $configFile ne '');
|
|||
|
||||
print "Starting..." unless ($quiet);
|
||||
my $session = WebGUI::Session->open($configFile);
|
||||
# We might take a while, reconnect if we get disconnected for inactivity
|
||||
$session->db->dbh->{mysql_auto_reconnect} = 1;
|
||||
print "OK\n" unless ($quiet);
|
||||
|
||||
print "Looking for descendant replationships...\n" unless ($quiet);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
|
||||
use Getopt::Long;
|
||||
use WebGUI::Paths -inc;
|
||||
use WebGUI::Asset;
|
||||
|
|
@ -81,7 +82,11 @@ sub reindexSite {
|
|||
my @searchableAssetIds;
|
||||
while (my ($id, $class) = $rs->array) {
|
||||
my $asset = WebGUI::Asset->new($session,$id,$class);
|
||||
if (defined $asset && $asset->get("state") eq "published" && ($asset->get("status") eq "approved" || $asset->get("status") eq "archived")) {
|
||||
if ( !$asset ) {
|
||||
warn sprintf "- Asset %s (%s) could not be instantiated\n", $id, $class;
|
||||
next;
|
||||
}
|
||||
if ($asset->get("state") eq "published" && ($asset->get("status") eq "approved" || $asset->get("status") eq "archived")) {
|
||||
print $asset->getId."\t".$asset->getTitle."\t";
|
||||
my $t = [Time::HiRes::gettimeofday()];
|
||||
$asset->indexContent;
|
||||
|
|
@ -135,6 +140,23 @@ sub updateSite {
|
|||
print "\nSite indexing took ".Time::HiRes::tv_interval($siteTime)." seconds.\n";
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
sub readLines {
|
||||
my $file = shift;
|
||||
my @lines;
|
||||
if (open(my $fh, '<', $file)) {
|
||||
while (my $line = <$fh>) {
|
||||
$line =~ s/#.*//;
|
||||
$line =~ s/^\s+//;
|
||||
$line =~ s/\s+$//;
|
||||
next if !$line;
|
||||
push @lines, $line;
|
||||
}
|
||||
close $fh;
|
||||
}
|
||||
return @lines;
|
||||
}
|
||||
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
|
|
|||
|
|
@ -63,14 +63,19 @@ my $missingModule = 0;
|
|||
|
||||
checkModule("Test::Tester", "0" );
|
||||
checkModule("LWP", 5.833 );
|
||||
checkModule("HTML::Form", 5.800, 2 );
|
||||
checkModule("Net::DNS", 0.66, );
|
||||
checkModule("Try::Tiny", 0.07, );
|
||||
checkModule("HTTP::Request", 1.40 );
|
||||
checkModule("HTTP::Headers", 1.61 );
|
||||
checkModule("Test::More", 0.82, 2 );
|
||||
checkModule("Test::More", 0.96, 2 );
|
||||
checkModule("Test::MockObject", 1.02, 2 );
|
||||
checkModule("Test::Deep", 0.095, );
|
||||
checkModule("Test::LongString", 0.13, 2 );
|
||||
checkModule("Test::Exception", 0.27, 2 );
|
||||
checkModule("Test::Differences", 0.5, 2 );
|
||||
checkModule("Test::Class", 0.31, 2 );
|
||||
checkModule("Test::MockTime", 0.09, 2 );
|
||||
checkModule("Pod::Coverage", 0.19, 2 );
|
||||
checkModule("Text::Balanced", 2.00, 2 );
|
||||
checkModule("Capture::Tiny", 0.08, 2 );
|
||||
|
|
@ -101,6 +106,7 @@ checkModule("HTML::Template", 2.9 );
|
|||
checkModule("HTML::Template::Expr", 0.07, 2 );
|
||||
checkModule("Template", 2.20, 2 );
|
||||
checkModule("XML::FeedPP", 0.40 );
|
||||
checkModule("XML::FeedPP::MediaRSS", 0.02 );
|
||||
checkModule("JSON", 2.12 );
|
||||
checkModule("JSON::Any", 1.22 );
|
||||
checkModule("Config::JSON", '1.5000' );
|
||||
|
|
@ -132,9 +138,9 @@ checkModule("Module::Find", "0.06" );
|
|||
checkModule("Class::C3", "0.21" );
|
||||
checkModule("Params::Validate", "0.91" );
|
||||
checkModule("Clone", "0.31" );
|
||||
checkModule('HTML::Packer', "0.4" );
|
||||
checkModule('JavaScript::Packer', '0.04' );
|
||||
checkModule('CSS::Packer', '0.2' );
|
||||
checkModule('JavaScript::Packer', '1.002' );
|
||||
checkModule('CSS::Packer', '1.000' );
|
||||
checkModule('HTML::Packer', "1.000" );
|
||||
checkModule('Business::Tax::VAT::Validation', '0.20' );
|
||||
checkModule('Crypt::SSLeay', '0.57' );
|
||||
checkModule('Scope::Guard', '0.20' );
|
||||
|
|
@ -170,6 +176,8 @@ checkModule('Starman', '0.2010', 2);
|
|||
checkModule('App::Cmd', '0.311' );
|
||||
checkModule('Devel::StackTrace', '1.27' );
|
||||
checkModule('Devel::StackTrace::WithLexicals', '0.03' );
|
||||
checkModule('Data::ICal', '0.16' );
|
||||
checkModule('Geo::Coder::Googlev3', '0.07' );
|
||||
|
||||
failAndExit("Required modules are missing, running no more checks.") if $missingModule;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue