Proper naming for upgrade script (v2)
Forward port of generating a list of Rich Editors with correct version status.
This commit is contained in:
parent
dc4f719dd9
commit
587b03b51c
5 changed files with 32 additions and 1 deletions
|
|
@ -43,6 +43,7 @@
|
|||
6.8.7
|
||||
- fix [ 1437186 ] 6.8.7 deploy DataForm package does not copy fields
|
||||
- fix [ 1437563 ] Data picker intermittent for Admin
|
||||
- fix [ 1437977 ] richeditor selectbox options not versioned, trashed appear
|
||||
|
||||
6.8.7
|
||||
- fix [ 1431098 ] op=becomeUser can become non-existent userIds
|
||||
|
|
|
|||
|
|
@ -381,6 +381,30 @@ sub getEditForm {
|
|||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getList ( )
|
||||
|
||||
Returns a list of all available richEditors, considering revisionDate and asset status
|
||||
|
||||
NOTE: This is a class method.
|
||||
|
||||
=cut
|
||||
|
||||
sub getList {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $sql = "select asset.assetId, assetData.revisionDate from RichEdit left join asset on asset.assetId=RichEdit.assetId left join assetData on assetData.revisionDate=RichEdit.revisionDate and assetData.assetId=RichEdit.assetId where asset.state='published' and assetData.revisionDate=(SELECT max(revisionDate) from assetData where assetData.assetId=asset.assetId and (assetData.status='approved' or assetData.tagId=?)) order by assetData.title";
|
||||
my $sth = $session->db->read($sql, [ $session->scratch->get('versionTag') ] );
|
||||
my %richEditors;
|
||||
tie %richEditors, 'Tie::IxHash';
|
||||
while (my ($id, $version) = $sth->array) {
|
||||
$richEditors{$id} = WebGUI::Asset::RichEdit->new($session, $id, undef, $version)->getTitle;
|
||||
}
|
||||
$sth->finish;
|
||||
return \%richEditors;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getToolbar ( )
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ sub www_editSettings {
|
|||
-label=>$i18n->get("default rich editor"),
|
||||
-hoverHelp=>$i18n->get("default rich editor description"),
|
||||
-value=>[$session->setting->get("richEditor")],
|
||||
-options=>$session->db->buildHashRef("select assetData.assetId,assetData.title from asset left join assetData on asset.assetId=assetData.assetId where asset.className='WebGUI::Asset::RichEdit' order by assetData.title"),
|
||||
-options=>WebGUI::Asset::RichEdit->getList($session),
|
||||
-defaultValue=>["PBrichedit000000000001"]
|
||||
);
|
||||
$tabform->getTab("ui")->integer(
|
||||
|
|
|
|||
|
|
@ -242,11 +242,17 @@ print "\nREADY TO BEGIN UPGRADES\n" unless ($quiet);
|
|||
my $notRun = 1;
|
||||
|
||||
chdir($upgradesPath);
|
||||
use Data::Dumper;
|
||||
foreach my $filename (keys %config) {
|
||||
print "Considering $filename\n";
|
||||
my $clicmd = $config{$filename}{mysqlCLI} || $mysql;
|
||||
my $dumpcmd = $config{$filename}{mysqlDump} || $mysqldump;
|
||||
my $backupTo = $config{$filename}{backupPath} || $backupDir;
|
||||
mkdir($backupTo);
|
||||
print Dumper \%config;
|
||||
print Dumper \%upgrade;
|
||||
print ("sql:".$upgrade{$config{$filename}{version}}{sql}."\n");
|
||||
print ("pl:".$upgrade{$config{$filename}{version}}{pl}."\n");
|
||||
while ($upgrade{$config{$filename}{version}}{sql} ne "" || $upgrade{$config{$filename}{version}}{pl} ne "") {
|
||||
my $upgrade = $upgrade{$config{$filename}{version}}{from};
|
||||
unless ($skipBackup) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue