Skip to content

Commit 500cce3

Browse files
authored
[4.4] Fix finder helper addContentType duplicate entry for key 'title' (#43053)
1 parent c5b8617 commit 500cce3

File tree

1 file changed

+9
-1
lines changed
  • administrator/components/com_finder/src/Indexer

1 file changed

+9
-1
lines changed

administrator/components/com_finder/src/Indexer/Helper.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,16 @@ public static function addContentType($title, $mime = null)
247247
$db->setQuery($query);
248248
$db->execute();
249249

250+
// Cache the result
251+
$type = new \stdClass();
252+
$type->title = $title;
253+
$type->mime = $mime ?? '';
254+
$type->id = (int) $db->insertid();
255+
256+
$types[$title] = $type;
257+
250258
// Return the new id.
251-
return (int) $db->insertid();
259+
return $type->id;
252260
}
253261

254262
/**

0 commit comments

Comments
 (0)