From 584fe7eb95126ea33bfb8deb89cc8e370864391e Mon Sep 17 00:00:00 2001 From: lexx Date: Mon, 15 Jan 2024 17:33:24 +0200 Subject: [PATCH] fix controllers --- src/Http/Controller/RecordController.php | 5 ++--- src/Record/Record.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Http/Controller/RecordController.php b/src/Http/Controller/RecordController.php index 3b2623d..6c5c663 100644 --- a/src/Http/Controller/RecordController.php +++ b/src/Http/Controller/RecordController.php @@ -62,18 +62,18 @@ class RecordController extends Controller $limit = 30; $records = []; $graphArray = null; - $graph = $this->query ->filter($arguments) ->limit($limit) ->status(explode(",", $arguments["status_in"])) ->skip($skip) ->sort($sort) - ->childrenFields($schema->visible) + ->childrenFields($schema?->visible ?? []) ->childrenDepth(1) ->parentsDepth(0) ->runWithCount(); + $records = $graph->getRootRecords()->toArray(); @@ -102,7 +102,6 @@ class RecordController extends Controller } return $data; } - $data["inModal"] = false; return $this->svelte->render( layout: "channel", diff --git a/src/Record/Record.php b/src/Record/Record.php index cde7304..7821d55 100644 --- a/src/Record/Record.php +++ b/src/Record/Record.php @@ -29,7 +29,7 @@ class Record implements JsonSerializable if(is_array($value)){ return $this->indexValues($value ?? []); } - return (string)$value; + return str_replace(array("\r", "\n"), '', strip_tags((string)$value)); }) ->values()->join(" ")." ". $this->_file?->originalName ?? "")); }