Skip to content

Commit

Permalink
Merge pull request #49 from CU-CommunityApps/d10
Browse files Browse the repository at this point in the history
d10 fixes for accessCheck and file_save_data
  • Loading branch information
melissagore authored Oct 11, 2023
2 parents e66aaa8 + 308ed76 commit 97af4ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Form/LocalistEntityForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/LocalistProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '',
Expand Down

0 comments on commit 97af4ff

Please sign in to comment.