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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

richardp created an issue. See original summary.

rvallejo’s picture

Confirming 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).

ndobromirov’s picture

Status: Active » Needs review
FileSize
657 bytes

Hi all,

Here is a patch for the solution described above.

BR,
Nikolay Dobromirov.

rlhawk’s picture

Title: Unlimited Number of values breaks-- but I have a fix » Unlimited number of values causes fatal error when editing node
Version: 7.x-2.0-beta1 » 7.x-2.x-dev
Status: Needs review » Reviewed & tested by the community

I can confirm that this patch addresses the issue.

  • rlhawk committed 74ca4ec on 7.x-2.x authored by ndobromirov
    Issue #2575187 by ndobromirov, richardp: Unlimited number of values...
rlhawk’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks for the patch.

Status: Fixed » Closed (fixed)

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