ElkArte Community

Elk Development => Feature Discussion => Exterminated Features => Topic started by: emanuele on August 15, 2014, 03:09:44 pm

Title: undefined index
Post by: emanuele on August 15, 2014, 03:09:44 pm
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
Title: Re: undefined index
Post by: Spuds on August 15, 2014, 05:22:38 pm
That one is not immediately obvious to me ... any ideas?
Title: Re: undefined index
Post by: emanuele on August 15, 2014, 05:43:54 pm
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