Hi,
After updating to 7.x-1.3, when I access My Account & other pages, it randomly shows Notice: Undefined index: #view_mode in field_formatter_class_preprocess_field() (line 61 of public_html/sites/all/modules/field_formatter_class/field_formatter_class.module).
First I thought it was the bug of Field Formatter Class module. After reading this #1888604: Notice: Undefined index: #view_mode in field_formatter_class.module which gave me some clues, I checked through the codes of realname.module, and added
'#view_mode' => $view_mode,
to the array of line #176
$account->content['realname'] = array(
...
...
After that, the notice disappeared. I doubt if this is the solution. Kindly advise. Thanks
Comments
Comment #2
dbouman CreditAttribution: dbouman at Mindgrub Technologies commentedI was getting this same issue when using Display Suite Extras with field templates enabled.
The code change worked for me. Here it is in patch form.
Comment #3
hass CreditAttribution: hass commentedComment #4
Adrião Neves CreditAttribution: Adrião Neves commentedThat worked. Thanks!
Comment #5
mrtndlmt CreditAttribution: mrtndlmt commentedThat works for me!
Comment #6
jerrac CreditAttribution: jerrac commented#2 patch removed my error as well.
Thanks!
Comment #7
donquixote CreditAttribution: donquixote as a volunteer commentedCould also be causing this issue in ds: #2261001: Notice: Undefined index: #view_mode in ds_extras_preprocess_field()
Patch looks reasonable to me and works.
Comment #8
donquixote CreditAttribution: donquixote as a volunteer commentedAlso this change is needed:
And maybe the '#items' should get something more bullet-proof than
array(TRUE)
.There are many modules that want to mess with theme_field(). They all expect a specific format.
Comment #9
MrPaulDriver CreditAttribution: MrPaulDriver commentedBe good to see this committed
Comment #10
jmev CreditAttribution: jmev commentedSeems similar to this issue: https://www.drupal.org/node/1928470#comment-7737419. Of course, field_empty_text is obsolete now, but the issue seems common.
I will say that this appeared for me only after a code push to dev server, and disappeared after simply visiting the display suite fields page (/admin/structure/ds/fields) and then returning to the original page it appeared on, as if the database was somehow updated/refreshed. I'm still applying the patch in the hopes that it never resurfaces to irritate the client.
I agree with MrPaulDriver on committing the patch.
Comment #11
ikeigenwijs CreditAttribution: ikeigenwijs commented#2 worked for us
#8 sounds logical but can have implications down the line for other modules
Comment #12
hass CreditAttribution: hass commentedSee #3
Comment #13
giupenni CreditAttribution: giupenni commented#2 works for me!
Comment #14
trumanru CreditAttribution: trumanru commented#2 work in my environment.
I think #8 should be addressed to another issue.
#3:
- tests passed
- 9 users (with me) approved the patch is working
The patch should be committed!
Comment #15
hass CreditAttribution: hass commentedStill no tests added.
Comment #16
g33kg1rl CreditAttribution: g33kg1rl commentedThis patch fixes the issue for me too.
Comment #17
ntym CreditAttribution: ntym commentedI had same issue, but it's not the realname module bug.
Field_formatter_class module fixed that in last dev - https://www.drupal.org/project/field_formatter_class/issues/1939108
Comment #18
hass CreditAttribution: hass commentedThanks for your info.
Comment #19
hass CreditAttribution: hass commented