Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I try to set up an "unlimited" files field, it actually died with a fatal error. That's why I am setting the priority as "Critical".
But, I have a very easy fix. I fixed it by editing encrypted_files.module, line 155 - 159, make it look like this:
foreach ($element as $key => $item) {
if (is_numeric($key)) {
$element[$key]['#upload_validators']['encrypted_files_validate_encrypt_config'] = array($context['field']['settings']['encrypt_config']);
}
}
What's happening is it's testing to make sure the $key is numeric before proceeding. That's all you need to do.
Richard
Comment | File | Size | Author |
---|---|---|---|
#3 | encrypted_files-unlimited-number-of-values-breaks-2575187-3-D7.patch | 657 bytes | ndobromirov |
Comments
Comment #2
rvallejo CreditAttribution: rvallejo commentedConfirming this fixes an issue for me where I would get this error (Fatal error: Cannot use string offset as an array in .../sites/all/modules/encrypted_files/encrypted_files.module on line 155) when creating/editing nodes with an unlimited file field, even when that file field is not configured to save encrypted files (content type and field existed prior to enabling encrypted files module).
Comment #3
ndobromirov CreditAttribution: ndobromirov at FFW commentedHi all,
Here is a patch for the solution described above.
BR,
Nikolay Dobromirov.
Comment #4
rlhawkI can confirm that this patch addresses the issue.
Comment #6
rlhawkCommitted. Thanks for the patch.