I'm trying to deploy filefield sources 8.x-1.x-dev on an already existing Drupal 8.1.3 site. When I go to enable either "Autocomplete reference textfield" or "File attach from server directory", and then go to edit my node, I get a white screen with "The website encountered an unexpected error. Please try again later." and the following error in my error.log file:

[Sat Jun 25 13:21:49.235694 2016] [:error] [pid 30014] [client xx.xx.xx.xx:34934] TypeError: Argument 2 passed to Drupal\\Component\\Utility\\NestedArray::getValue() must be of the type array, null given, called in xxx/public_html/modules/filefield_sources/filefield_sources.module on line 236 in xxx/core/lib/Drupal/Component/Utility/NestedArray.php on line 69, referer: http://xx/node/add

(xx's mine).

Looking at that line, argument 2 is $parents, line 236 is:

$field_element = NestedArray::getValue($complete_form, $parents);

And argument 2 is defined a few lines above as:

$parents = array_slice($element['#array_parents'], 0, -1);

CommentFileSizeAuthor
#8 filefield_sources-wsod-2755707-8.patch932 bytespingwin4eg
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TrevorBradley created an issue. See original summary.

ipwa’s picture

Just wanted to say that the remote url function is working great in D8, thanks guys!

fotidim’s picture

I also have the issue using any option (Remote URL textfield etc)

juliencarnot’s picture

Same error here when visiting the add node form after adding the remote URL textfield. @ipwa are you using the latest code in the dev branch from drupal.org?

ogggg’s picture

I have the same error

ogggg’s picture

quick fix, filefield_sources.module, line 184

        $element = call_user_func_array($callback, array(
          &$element,
          $form_state,
          &$complete_form,
        ));
pingwin4eg’s picture

Assigned: Unassigned » pingwin4eg

Thanks @ogggg it really works. Let's make a patch then.

pingwin4eg’s picture

Assigned: pingwin4eg » Unassigned
Status: Active » Needs review
FileSize
932 bytes
proweb.ua’s picture

#8 work

tran_tien’s picture

#8 work beautifuly

juliencarnot’s picture

Status: Needs review » Reviewed & tested by the community

Works for me too!

jhuhta’s picture

Works for us too.

By the way, there is a similar call in filefield_sources_field_validate(). I wonder if the change should be applied there as well.

Dave Kopecek’s picture

#8 Works for me as well. Can we get this committed ?

GiorgosK’s picture

#8 works great for remote/reference (did not test others)
please commit

profak’s picture

Status: Reviewed & tested by the community » Fixed

Thanks guys, pushed to 1.x.

pingwin4eg’s picture

Thank you @profak.

I guess it would be fair to give credits to others too. At least to @TrevorBradley for reporting the issue and to @ogggg for pointing the solution.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.