Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

resource MDL-20320 upgrade: set all PDF files to Show navigation: 'Ye…

…s, without frame' on previous installation
  • Loading branch information...
commit 901dd449d6e03e0aab4407a14c516b0190490c65 1 parent 3b94f11
jerome authored
Showing with 16 additions and 3 deletions.
  1. +14 −1 mod/resource/db/upgrade.php
  2. +2 −2 mod/resource/version.php
15 mod/resource/db/upgrade.php
View
@@ -63,8 +63,21 @@ function xmldb_resource_upgrade($oldversion=0) {
}
}
-//===== 1.9.0 upgrade line ======//
+ //Set 'Show navigation' setting to "Yes, without frame" for PDF file resources
+ //Explanation: due to MDL-20320 bug, PDF can now be displayed as 'No', 'Yes, with frame' and 'Yes, without frame'.
+ //The default being 'no', PDF resources on previous installations need to be set back to 'Yes, without frame'
+ if ($result && $oldversion < 2007101510) {
+ $sql = "UPDATE mdl_resource SET options = 'objectframe' WHERE (UPPER(reference) LIKE '%.PDF'
+ OR UPPER(reference) LIKE '%.FDF'
+ OR UPPER(reference) LIKE '%.XDP'
+ OR UPPER(reference) LIKE '%.XFD'
+ OR UPPER(reference) LIKE '%.XFDF')
+ AND type='file' AND ".sql_isempty('resource', 'popup', false, true)."
+ AND (".sql_isempty('resource', 'options', false, false)." OR options = 'frame')";
+ execute_sql($sql);
+ }
+//===== 1.9.0 upgrade line ======//
return $result;
}
4 mod/resource/version.php
View
@@ -5,8 +5,8 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2007101509;
-$module->requires = 2007101509; // Requires this Moodle version
+$module->version = 2007101510;
+$module->requires = 2007101510; // Requires this Moodle version
$module->cron = 0;
?>
Please sign in to comment.
Something went wrong with that request. Please try again.