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.
I updated from redirect-7.x-1.0-beta2 to 3, which introduced a url redirect fieldset for all entities that support redirects. I now get this warning on editing media (from media module):
Warning: array_diff_key() [function.array-diff-key]: Argument #1 is not an array in redirect_field_attach_form() (line 1397 of /sites/all/modules/redirect/redirect.module).
Is this for Redirect or for Media to fix?
Comment | File | Size | Author |
---|---|---|---|
#5 | mediabeta4-arraydiff-warning_1190968.patch | 469 bytes | theapi |
Comments
Comment #1
Dave ReidSounds more like something in Media since a call to $uri = entity_uri($entity_type, $entity) should return either FALSE or array('uri' => '...', 'options' => array(...)) with the options array already defined. Redirect already handles the case if the return is FALSE.
Comment #2
Dave ReidWell this seems to be that you cannot call entity_uri() on a file entity as it already has $entity->uri defined as a string. Core bug is #1057242: entity_uri() should not use $entity->uri (was $file->uri doesn't match the contract for uri callbacks). I need to add a workaround in Redirect, so moving back to my issue queue.
Comment #3
Dave ReidFixed in Git with http://drupalcode.org/project/redirect.git/commit/ecf23c5. Thank you very much for reporting this issue.
Comment #5
theapi CreditAttribution: theapi commentedFor those of us not ready to take the leap to Media 1.0-beta5 just yet, here's a modified version of the above patch that works with Media 1.0-beta4