diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f3616ab7f..801640768 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -3,6 +3,7 @@ - fixed: Non-admin users can now add Gallery assets - fixed: Thingy Data now retains File and Images if they aren't explicitly deleted - fixed: Rich Editor no longer makes other form controls show up as code in Safari 3 + - fixed: allowMedia addition to Rich Editor no longer causes upgrade problems - fixed: Shop->hasShippingAddress help grammatical error - fixed: can now turn off inheritUrlFromParent and the code is now more robust, moved from Asset->update to Asset->fixUrl. diff --git a/docs/upgrades/upgrade_7.5.12-7.5.13.pl b/docs/upgrades/upgrade_7.5.12-7.5.13.pl index 37df03937..44fa0442e 100644 --- a/docs/upgrades/upgrade_7.5.12-7.5.13.pl +++ b/docs/upgrades/upgrade_7.5.12-7.5.13.pl @@ -42,6 +42,15 @@ sub addRichEditMedia { my $session = shift; print "\tAdding Media switch to Rich Edit..." unless $quiet; + # Make sure it wasn't added by previous upgrade + my $sth = $session->db->read('DESCRIBE `RichEdit`'); + while (my ($col) = $sth->array) { + if ( $col eq 'allowMedia' ) { + print "Already done, skipping.\n" unless $quiet; + return; + } + } + $session->db->write( q{ ALTER TABLE RichEdit ADD COLUMN allowMedia INT }, ); diff --git a/docs/upgrades/upgrade_7.5.8-7.5.9.pl b/docs/upgrades/upgrade_7.5.8-7.5.9.pl index 16f039c7f..a8687cf55 100644 --- a/docs/upgrades/upgrade_7.5.8-7.5.9.pl +++ b/docs/upgrades/upgrade_7.5.8-7.5.9.pl @@ -29,6 +29,7 @@ my $quiet; # this line required my $session = start(); # this line required addRichEditInlinePopup($session); +addRichEditMedia( $session ); updateRichEditorButtons($session); setPMFloatingDuration($session); @@ -59,6 +60,19 @@ sub addRichEditInlinePopup { print "Done!\n" unless $quiet; } +#---------------------------------------------------------------------------- +# Add the "allowMedia" field to Rich Edit assets +sub addRichEditMedia { + my $session = shift; + print "\tAdding Media switch to Rich Edit..." unless $quiet; + + $session->db->write( + q{ ALTER TABLE RichEdit ADD COLUMN allowMedia INT }, + ); + + print "DONE!\n" unless $quiet; +} + #---------------------------------------------------------------------------- sub updateRichEditorButtons { my $session = shift;