From f02e55008b83f0d4ec8df13d4f7922b5e400d5ed Mon Sep 17 00:00:00 2001 From: Jefferson49 <81484983+Jefferson49@users.noreply.github.com> Date: Sat, 27 Aug 2022 23:02:30 +0200 Subject: [PATCH] Data Fix via control panel doesn't work (this is intended). 'Added some code the "sourcesToFix" method to avoid errors in the front end. Fixes #9 --- RepositoryHierarchy.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RepositoryHierarchy.php b/RepositoryHierarchy.php index 637551c..8097631 100644 --- a/RepositoryHierarchy.php +++ b/RepositoryHierarchy.php @@ -494,6 +494,9 @@ public function fixOptions(Tree $tree): string */ protected function sourcesToFix(Tree $tree, array $params): ?Collection { + //If data fix is called from wrong context, return + if (!isset($this->repository_xref)) return null; + if ($params[CallNumberCategory::VAR_CATEGORY_NAME] === '' || $params[self::VAR_DATA_FIX_CATEGORY_NAME_REPLACE] === '') { return null; }