aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+github@gmail.com>2024-07-08 15:50:03 +0200
committerJan-Hendrik Willms <tleilax+github@gmail.com>2024-07-08 16:24:10 +0200
commit58ec440501ee821931706fd12dbd9331b0eaca50 (patch)
tree26fbd06d9f3775b16a5f01b549b22a97a454258c /lib
parent471197f7abc27b0fdc65e453587a74906922f9d5 (diff)
convert oersearch to sfc, re #4302tic-4302
Diffstat (limited to 'lib')
-rw-r--r--lib/classes/TwilloConnector.php2
-rw-r--r--lib/models/OERMaterial.php3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/classes/TwilloConnector.php b/lib/classes/TwilloConnector.php
index 40ceff8..e7dd8b4 100644
--- a/lib/classes/TwilloConnector.php
+++ b/lib/classes/TwilloConnector.php
@@ -49,7 +49,7 @@ class TwilloConnector
*/
public static function uploadMaterial(OERMaterial $material, $user_id = null)
{
- $user_id || $user_id = User::findCurrent()->id;
+ $user_id = $user_id ?? User::findCurrent()->id;
$base = new \EduSharingApiClient\EduSharingHelperBase(
self::$twillo_base_url,
file_get_contents($GLOBALS['STUDIP_BASE_PATH']."/config/twillo-private.key"),
diff --git a/lib/models/OERMaterial.php b/lib/models/OERMaterial.php
index 224c860..2048457 100644
--- a/lib/models/OERMaterial.php
+++ b/lib/models/OERMaterial.php
@@ -257,6 +257,9 @@ class OERMaterial extends SimpleORMap
public function setTopics($tags)
{
+ $tags = array_map('trim', $tags);
+ $tags = array_filter($tags);
+
$statement = DBManager::get()->prepare("
DELETE FROM oer_tags_material
WHERE material_id = :material_id