diff --git a/src/Form/LocalistEntityForm.php b/src/Form/LocalistEntityForm.php index e934cf3..82b8e4e 100644 --- a/src/Form/LocalistEntityForm.php +++ b/src/Form/LocalistEntityForm.php @@ -347,6 +347,7 @@ public function save(array $form, FormStateInterface $form_state) { public function exist($id) { $entity = $this->entityTypeManager->getStorage('localist_pull')->getQuery() ->condition('id', $id) + ->accessCheck(TRUE) ->execute(); return (bool) $entity; } diff --git a/src/LocalistProcessor.php b/src/LocalistProcessor.php index 68ee360..1b31e82 100644 --- a/src/LocalistProcessor.php +++ b/src/LocalistProcessor.php @@ -157,7 +157,7 @@ private function create_file_and_array($url) { $data = file_get_contents($url); $path = 'public://localist'; $this->file_system->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY); - $file = file_save_data($data, $path .'/'. $photo_name, FileSystemInterface::EXISTS_REPLACE); + $file = \Drupal::service('file.repository')->writeData($data, $path .'/'. $photo_name, FileSystemInterface::EXISTS_REPLACE); $photo_array = [ 'target_id' => $file->id(), 'alt' => '',