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);
Comment | File | Size | Author |
---|---|---|---|
#8 | filefield_sources-wsod-2755707-8.patch | 932 bytes | pingwin4eg |
Comments
Comment #2
ipwa CreditAttribution: ipwa commentedJust wanted to say that the remote url function is working great in D8, thanks guys!
Comment #3
fotidim CreditAttribution: fotidim commentedI also have the issue using any option (Remote URL textfield etc)
Comment #4
juliencarnot CreditAttribution: juliencarnot commentedSame 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?
Comment #5
ogggg CreditAttribution: ogggg commentedI have the same error
Comment #6
ogggg CreditAttribution: ogggg commentedquick fix, filefield_sources.module, line 184
Comment #7
pingwin4egThanks @ogggg it really works. Let's make a patch then.
Comment #8
pingwin4egComment #9
proweb.ua CreditAttribution: proweb.ua commented#8 work
Comment #10
tran_tien CreditAttribution: tran_tien commented#8 work beautifuly
Comment #11
juliencarnot CreditAttribution: juliencarnot commentedWorks for me too!
Comment #12
jhuhta CreditAttribution: jhuhta commentedWorks 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.
Comment #13
Dave Kopecek#8 Works for me as well. Can we get this committed ?
Comment #14
GiorgosK#8 works great for remote/reference (did not test others)
please commit
Comment #16
profak CreditAttribution: profak as a volunteer commentedThanks guys, pushed to 1.x.
Comment #17
pingwin4egThank 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.