From 06e8c9b4e8a477c059cb2c803343cef87412b851 Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 19 Jun 2023 13:36:15 +0200 Subject: [PATCH 1/3] SEBSERV-449 fixed name search on Moodle side and fixed query SEB Server --- .../impl/moodle/plugin/MoodlePluginCourseAccess.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginCourseAccess.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginCourseAccess.java index d8568f3b..a5505674 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginCourseAccess.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginCourseAccess.java @@ -82,6 +82,9 @@ public class MoodlePluginCourseAccess extends AbstractCachedCourseAccess impleme public static final String PARAM_PAGE_START = "startneedle"; public static final String PARAM_PAGE_SIZE = "perpage"; + public static final String SQL_QUIZ_NAME = "m.name"; + public static final String SQL_COURSE_NAME = "shortname"; + public static final String SQL_CONDITION_TEMPLATE = //"(startdate >= %s or timecreated >=%s) and (enddate is null or enddate = 0 or enddate >= %s)"; "(startdate is null OR startdate = 0 OR startdate >= %s) AND (enddate is null or enddate = 0 OR enddate >= %s)"; @@ -437,9 +440,13 @@ public class MoodlePluginCourseAccess extends AbstractCachedCourseAccess impleme final LinkedMultiValueMap attributes = new LinkedMultiValueMap<>(); if (this.applyNameCriteria && StringUtils.isNotBlank(nameCondition)) { - sqlCondition = sqlCondition + " AND (name LIKE '" + + sqlCondition = sqlCondition + " AND (" + + SQL_QUIZ_NAME + + " LIKE '" + Utils.toSQLWildcard(nameCondition) + - "' OR shortname LIKE '" + + "' OR " + + SQL_COURSE_NAME + + " LIKE '" + Utils.toSQLWildcard(nameCondition) + "')"; } From c0e6687647999895a2514fdd3249ba4270fe3612 Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 19 Jun 2023 13:42:39 +0200 Subject: [PATCH 2/3] preparing for patch release 1.5.1 --- README.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.rst b/README.rst index 9d34656a..d36ebd4f 100644 --- a/README.rst +++ b/README.rst @@ -98,8 +98,6 @@ Bugfixes: Docker-Image: -TODO - SEB - SEB Server Compatibility ------------------------------ From e0d1b48192ad1004f530f0edfed433a30a0e8d98 Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 19 Jun 2023 14:21:50 +0200 Subject: [PATCH 3/3] preparing for next relese 1.5.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bba665d8..1f4ea900 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ jar - 1.5.1 + 1.5.2-SNAPSHOT ${sebserver-version} ${sebserver-version} UTF-8