Skip to content

Commit

Permalink
Fix: php warnings and deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
rhell4 committed Aug 28, 2024
1 parent c3ade55 commit 75ef957
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
3 changes: 2 additions & 1 deletion classes/editor_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public function getLatestLibraryVersions() {

return $DB->get_records_sql("
SELECT hl4.id, hl4.machine_name, hl4.title, hl4.major_version,
hl4.minor_version, hl4.patch_version, hl4.has_icon, hl4.restricted
hl4.minor_version, hl4.patch_version, hl4.has_icon, hl4.restricted,
0 AS patch_version_in_folder_name
FROM {hvp_libraries} hl4
JOIN ({$maxminorversionsql}) hl3
ON hl4.machine_name = hl3.machine_name
Expand Down
1 change: 1 addition & 0 deletions classes/file_storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ private static function readFileTree($source, $options, $archive = null, $relati
if (empty($archive) && $exportzip) {
$archive = new \ZipArchive();
$path = tempnam(get_request_storage_directory(),'libdir');
unlink($path);
$archive->open($path, \ZipArchive::CREATE || \ZipArchive::OVERWRITE);
// Set recursion flag.
$top = true;
Expand Down
38 changes: 21 additions & 17 deletions classes/framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -1521,23 +1521,27 @@ public function loadLibrary($machinename, $majorversion, $minorversion) {
'minor_version' => $minorversion
));

$librarydata = array(
'libraryId' => $library->id,
'machineName' => $library->machine_name,
'title' => $library->title,
'majorVersion' => $library->major_version,
'minorVersion' => $library->minor_version,
'patchVersion' => $library->patch_version,
'embedTypes' => $library->embed_types,
'preloadedJs' => $library->preloaded_js,
'preloadedCss' => $library->preloaded_css,
'dropLibraryCss' => $library->drop_library_css,
'fullscreen' => $library->fullscreen,
'runnable' => $library->runnable,
'semantics' => $library->semantics,
'restricted' => $library->restricted,
'hasIcon' => $library->has_icon
);
if ($library) {
$librarydata = array(
'libraryId' => $library->id,
'machineName' => $library->machine_name,
'title' => $library->title,
'majorVersion' => $library->major_version,
'minorVersion' => $library->minor_version,
'patchVersion' => $library->patch_version,
'embedTypes' => $library->embed_types,
'preloadedJs' => $library->preloaded_js,
'preloadedCss' => $library->preloaded_css,
'dropLibraryCss' => $library->drop_library_css,
'fullscreen' => $library->fullscreen,
'runnable' => $library->runnable,
'semantics' => $library->semantics,
'restricted' => $library->restricted,
'hasIcon' => $library->has_icon
);
} else {
return [];
}

$dependencies = $DB->get_records_sql(
'SELECT hl.id, hl.machine_name, hl.major_version, hl.minor_version, hll.dependency_type
Expand Down

0 comments on commit 75ef957

Please sign in to comment.