Skip to content

Commit

Permalink
Fix pass by reference error (#4003)
Browse files Browse the repository at this point in the history
  • Loading branch information
janette authored Aug 29, 2023
1 parent d12af26 commit 372008e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
File renamed without changes.
5 changes: 3 additions & 2 deletions modules/json_form_widget/json_form_widget.module
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ function json_form_widget_file_submit(array $form, FormStateInterface $form_stat
function _json_form_widget_update_file(string $url, FormStateInterface $form_state) {
$fo = $form_state->getFormObject();
$storage = \Drupal::entityTypeManager()->getStorage('file');
$props = ['uri' => _json_form_widget_get_file_uri($url)];
$file = reset($storage->loadByProperties($props));
$uri = ['uri' => _json_form_widget_get_file_uri($url)];
$props = $storage->loadByProperties($uri);
$file = reset($props);

if ($file instanceof FileInterface) {
$file->setPermanent();
Expand Down

0 comments on commit 372008e

Please sign in to comment.