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.
After replacing a title, editing it to allow for filtered text and unlimited titles, and then unhiding in the Display tab, I got the following notice when viewing the node:
Notice: Undefined index: safe_value in title_field_formatter_view() (line 100 of /usr/share/drupal-RO/sites/all/modules/title/title.field.inc).
The notice does not go away. Running Drupal 7.22.
Comment | File | Size | Author |
---|---|---|---|
#23 | title-safe_value-2040055-22.patch | 707 bytes | plach |
#17 | notice_undefined-2040055-17.patch | 542 bytes | visabhishek |
#15 | undefined_safe_index_replaced_by_index-2040055-15.patch | 542 bytes | flux423 |
#14 | undefined_safe_index_replaced_by_index-2040055-14.patch | 542 bytes | flux423 |
#13 | undefined_safe_index_replaced_by_index-2040055-11.patch | 542 bytes | flux423 |
Comments
Comment #1
rei CreditAttribution: rei commentedI got the same error message
activating aggregation=yes in views, trigger the error message.
Comment #2
justindodge CreditAttribution: justindodge commentedLine 100 of title.field.inc inside of function
title_field_formatter_view()
has:$output = isset($items[0]) ? $items[0]['safe_value'] : '';
which looks like it needs to change the key of 'safe_value' to 'value':
$output = isset($items[0]) ? $items[0]['value'] : '';
Comment #3
creatile CreditAttribution: creatile commentedI also have the same message. It appears sometime after editing a page.
I am using drupal 7.24 and the following contrib modules :
Media 2x
ck editor link
ck editor link file
entity translation
Comment #4
cs_shadow CreditAttribution: cs_shadow commentedAs suggested by justindodge, replacing 'safe_value' by 'value' fixes this issue. It seems that the 'safe_value' index was not defined. Attached is a patch for the same.
Comment #6
cs_shadow CreditAttribution: cs_shadow commentedSorry. The last patch failed testing because I rolled it against wrong branch. This patch should work.
Comment #7
cs_shadow CreditAttribution: cs_shadow commentedComment #8
loudmu CreditAttribution: loudmu commentedpatch didn't work for me
Comment #9
OlyN CreditAttribution: OlyN commentedI re-rolled the patch in #6 to match the currently latest commit (6316555dbd6c4217e9068cde757bef61342f40f6).
Comment #11
flux423Greetings all,
This is my first time sharing a patch with the community!
Please tell me if I'm doing this wrong.
I've created a patch to work on the current version 7.x-1.0-alpha7.
Please review and test.
Comment #13
flux423Here's a revised patch to this issue.Disregard this post.
Comment #14
flux423Ops.. wrong name to the patch. Re-rolling this to be correct.
Comment #15
flux423The patch above needs review.
Comment #17
visabhishek CreditAttribution: visabhishek as a volunteer and at Azri Solutions commentedRe-Rolled Patch
Comment #19
visabhishek CreditAttribution: visabhishek as a volunteer and at Azri Solutions commentedMoving to latest Dev Branch
Comment #21
trumanru CreditAttribution: trumanru commentedWorks fine!
Thank you, visabhishek!
Comment #22
sgurlt CreditAttribution: sgurlt at Bright Solutions GmbH commentedConfirm, #17 works fine.
Comment #23
plachThis solution would introduce an XSS vulnerability: we need to ensure we always use a save value instead (see the attached patch).
Comment #25
plach