From 244655e92b782f027e160955a7b957d3f994aa65 Mon Sep 17 00:00:00 2001 From: Yannic Lapawczyk Date: Tue, 2 Jun 2026 17:51:32 +0200 Subject: [PATCH 1/5] Remove obsolete require of app/controllers/plugin_controller.php Stud.IP 6 removed app/controllers/plugin_controller.php; the base controllers (StudipController/PluginController) now live under lib/classes/ and are PSR-autoloaded. The hard-coded require_once therefore fatals ("Failed opening required") as soon as any of the plugin's controllers is dispatched. Dropping it lets the autoloader resolve the base classes. --- controllers/admin.php | 1 - controllers/task.php | 1 - controllers/taskWrapper.php | 1 - 3 files changed, 3 deletions(-) diff --git a/controllers/admin.php b/controllers/admin.php index d7793c7..d09f730 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -13,7 +13,6 @@ * @category Stud.IP */ -require_once('app/controllers/plugin_controller.php'); require_once('public/plugins_packages/integral-learning/MumieTaskPlugin/models/serverStructure/MumieServerInstance.php'); require_once('public/plugins_packages/integral-learning/MumieTaskPlugin/services/PermissionService.php'); diff --git a/controllers/task.php b/controllers/task.php index e080367..4750ec2 100644 --- a/controllers/task.php +++ b/controllers/task.php @@ -13,7 +13,6 @@ * @category Stud.IP */ -require_once('app/controllers/plugin_controller.php'); require_once('public/plugins_packages/integral-learning/MumieTaskPlugin/models/serverStructure/MumieServerInstance.php'); require_once('public/plugins_packages/integral-learning/MumieTaskPlugin/models/MumieHash.php'); require_once('public/plugins_packages/integral-learning/MumieTaskPlugin/services/SSOService.php'); diff --git a/controllers/taskWrapper.php b/controllers/taskWrapper.php index b57fc6d..bf9570c 100644 --- a/controllers/taskWrapper.php +++ b/controllers/taskWrapper.php @@ -13,7 +13,6 @@ * @category Stud.IP */ -require_once('app/controllers/plugin_controller.php'); require_once('public/plugins_packages/integral-learning/MumieTaskPlugin/models/serverStructure/MumieServerInstance.php'); require_once('public/plugins_packages/integral-learning/MumieTaskPlugin/models/MumieHash.php'); require_once('public/plugins_packages/integral-learning/MumieTaskPlugin/services/SSOService.php'); From 74df06b0393096fea6cc54338977759f652a7946 Mon Sep 17 00:00:00 2001 From: Yannic Lapawczyk Date: Tue, 2 Jun 2026 17:52:16 +0200 Subject: [PATCH 2/5] Initialise new-server form variables The create-server view never set the name/url_prefix attributes for the shared ServerForm.php template and referenced an undefined $server when building the action link. Under PHP 8 these undefined variables are warnings that get rendered into the form (e.g. into the input value attributes). A new server has no id, so seed the fields empty and drop the server_id from the action link. --- views/admin/addServer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/views/admin/addServer.php b/views/admin/addServer.php index a876399..3ef2331 100644 --- a/views/admin/addServer.php +++ b/views/admin/addServer.php @@ -6,13 +6,13 @@ If it's called in the template MumieServer::find() will return an instance of stdClass and not MumieServer. I don't know why */ PageLayout::setTitle(dgettext("MumieTaskPlugin", "Neuer MUMIE-Server")); + $template->set_attribute('name', ''); + $template->set_attribute('url_prefix', ''); $template->set_attribute( 'action', PluginEngine::getLink( 'MumieTaskPlugin', - array( - 'server_id' => $server["server_id"] - ), + array(), 'admin/addServer' ) ); From 4648bbebc1e865d3f831ff91241444ff14e874a6 Mon Sep 17 00:00:00 2001 From: Yannic Lapawczyk Date: Tue, 2 Jun 2026 17:57:57 +0200 Subject: [PATCH 3/5] Initialise new-task form variables The create-task view only set a subset of the attributes that the shared TaskForm.php template reads (editTask sets them all). Under PHP 8 the missing ones are warnings rendered into the form, and the uninitialised duedate triggers a TypeError because TaskForm.php passes it to date(), which no longer accepts a string. Seed every field the template expects, with duedate as int 0. --- views/task_wrapper/addTask.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/views/task_wrapper/addTask.php b/views/task_wrapper/addTask.php index 447b47f..b25ab85 100644 --- a/views/task_wrapper/addTask.php +++ b/views/task_wrapper/addTask.php @@ -10,6 +10,16 @@ $collector->collect(); $template->set_attribute("serverStructure", $structuredServers); $template->set_attribute("collector", $collector); + $template->set_attribute("name", ""); + $template->set_attribute("server", ""); + $template->set_attribute("mumie_course", ""); + $template->set_attribute("mumie_coursefile", ""); + $template->set_attribute("task_url", ""); + $template->set_attribute("launch_container", ""); + $template->set_attribute("duedate", 0); + $template->set_attribute("passing_grade", null); + $template->set_attribute("is_graded", 0); + $template->set_attribute("missingServerConfig", false); $lang = getUserLanguage($GLOBALS['user']->id); $lang = substr($lang, 0, strpos($lang, "_")); $template->set_attribute("language", $lang); From 51732c54214996adc3c312b77a70cd5e32e36c29 Mon Sep 17 00:00:00 2001 From: Yannic Lapawczyk Date: Tue, 2 Jun 2026 17:58:25 +0200 Subject: [PATCH 4/5] Guard course structure entries without a link When a server's course JSON omits the "link" property, reading it raised an undefined-property warning under PHP 8 (silent in PHP 7). A null link is already handled in addCourseTask(), so coalesce to null. --- models/serverStructure/MumieCourse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/serverStructure/MumieCourse.php b/models/serverStructure/MumieCourse.php index a0cf03a..6d6a95c 100644 --- a/models/serverStructure/MumieCourse.php +++ b/models/serverStructure/MumieCourse.php @@ -63,7 +63,7 @@ public function __construct($coursewithtasks) { $this->name = $coursewithtasks->name; $this->coursefile = $coursewithtasks->pathToCourseFile; - $this->link = $coursewithtasks->link; + $this->link = $coursewithtasks->link ?? null; $this->tasks = []; if ($coursewithtasks->tasks) { foreach ($coursewithtasks->tasks as $task) { From 143d23e709415195418c0da4f47630f13d34a55e Mon Sep 17 00:00:00 2001 From: Yannic Lapawczyk Date: Tue, 2 Jun 2026 19:35:22 +0200 Subject: [PATCH 5/5] Quote MUMIE_* config keys in admin save actions Config::store() takes the field name as a string, but the privacy and authentication actions passed MUMIE_ORG / MUMIE_API_KEY / MUMIE_SHARE_* as bare words. PHP 7 coerced the undefined constants to their string names (with a notice); PHP 8 makes that a fatal "Undefined constant" error when saving the settings. Quote them. --- controllers/admin.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/controllers/admin.php b/controllers/admin.php index d09f730..deb5446 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -60,9 +60,9 @@ public function privacy_action() { if (Request::isPost()) { $config = Config::get(); - $config->store(MUMIE_SHARE_FIRSTNAME, Request::get('share_firstname')); - $config->store(MUMIE_SHARE_LASTNAME, Request::get('share_lastname')); - $config->store(MUMIE_SHARE_EMAIL, Request::get('share_email')); + $config->store("MUMIE_SHARE_FIRSTNAME", Request::get('share_firstname')); + $config->store("MUMIE_SHARE_LASTNAME", Request::get('share_lastname')); + $config->store("MUMIE_SHARE_EMAIL", Request::get('share_email')); PageLayout::postSuccess(dgettext('MumieTaskPlugin', 'Änderungen gespeichert') . '!'); } $this->redirect('admin/index'); @@ -143,8 +143,8 @@ public function authentication_action() { if (Request::isPost()) { $config = Config::get(); - $config->store(MUMIE_ORG, Request::get('mumie_org')); - $config->store(MUMIE_API_KEY, Request::get('mumie_api_key')); + $config->store("MUMIE_ORG", Request::get('mumie_org')); + $config->store("MUMIE_API_KEY", Request::get('mumie_api_key')); PageLayout::postSuccess(dgettext('MumieTaskPlugin', 'Änderungen gespeichert') . '!'); } $this->redirect('admin/index');