Skip to main content
Topic: undefined index (Read 2118 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

undefined index

Code: [Select]
8: Undefined index: custom_fields
http://www.elkarte.net/community/index.php?action=profile;area=lists;u=211
File: /.../community/themes/default/ProfileOptions.template.php
Line: 79

and related:
Code: [Select]
2: Invalid argument supplied for foreach()
http://www.elkarte.net/community/index.php?action=profile;area=lists;u=211
File: /.../community/themes/default/ProfileOptions.template.php
Line: 79
Bugs creator.
Features destroyer.
Template killer.

Re: undefined index

Reply #1

That one is not immediately obvious to me ... any ideas?

Re: undefined index

Reply #2

Yep, I had to dig it a bit.

I applied a workaround for that one (actually two, but the first may be useless because of the second...), though the "fix" is a bit more complex (and is probably a very good candidate for a 1.1, I'll track at github).

The problem is that when enabling custom fields $modSettings['displayFields'] is not set, and for that reason loadMemberContext doesn't even fill the custom_fields index.
At the moment I made it so that the index is always filled, but probably the displayFields should be filled when switching the core feature on/off.

ETA:
first workaround https://github.com/emanuele45/Dialogo/commit/80564424b4e842b113d6ff1d16b15234cb8a5f68
second workaround https://github.com/emanuele45/Dialogo/commit/cfbc1b2d51fffc589eeb2e5f65b0728fabd95b67
Bugs creator.
Features destroyer.
Template killer.