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 a picture doesn't have a specific mapped exif_field, a notice shows:
Notice: Undefined index: EXIF:IFD0:ImageDescription in exif_custom_process_entity() (Line 454 of ****/www/sites/all/modules/exif_custom/exif_custom.module).
Line 454 of exif_custom.module:
$array['und']['0']['value'] = $data[$values->exif_field];
A workaround is to check if the value exists first:
if(isset($data[$values->exif_field])){
$array['und']['0']['value'] = $data[$values->exif_field];
}
else{
$array['und']['0']['value'] = NULL;
}
Comment | File | Size | Author |
---|---|---|---|
#8 | exif_custom-n2055529-8.patch | 563 bytes | DamienMcKenna |
Comments
Comment #1
gaele CreditAttribution: gaele commentedThanks Kim Kahns. Here's the patch based on the suggestion above.
Comment #2
edwbaker CreditAttribution: edwbaker commentedThanks! In 7.x-1.x branch for next release.
Comment #3
sazcurrain CreditAttribution: sazcurrain commentedHi,
The problem reported isn't fully solved. The previous patch only fixes the default option in a switch-case statement, based in the type of the mapped property.
When testing the mapping to a taxonomy term, you get the following messge:
Here is a patch to fix the problem, using the same workarround from the previous patch.
Comment #4
sazcurrain CreditAttribution: sazcurrain commentedComment #5
gaele CreditAttribution: gaele commentedHi sazcurrain, you'd better open a new issue for this patch. This issue has status "Fixed".
Comment #6
edwbaker CreditAttribution: edwbaker commentedChanged to needs review.
Comment #8
DamienMcKennaThe patch in #4 needed to be rewritten to adhere to the Drupal coding standards.
I reviewed the code and I think the correct approach might be to skip processing the field if the EXIF value doesn't exist for that file.
Comment #9
DamienMcKennaComment #10
DamienMcKennaClosed a duplicate: #2184359: Notice: Undefined index: *** in exif_custom_process_entity() (line 413 from ***modules/exif_custom/exif_custom.module).
Comment #11
recrit CreditAttribution: recrit commentedThe #8 patch fixed the issue for me.
Comment #12
edwbaker CreditAttribution: edwbaker commentedPatch applied, will be in the next release.
Comment #13
DamienMcKenna@edwbaker: I couldn't see where in the commit log this patch was committed? The current codebase looks like it'd still have this problem.
Comment #14
joseph.olstadThanks DamienMckenna