ElkArte Community

Elk Development => Bug Reports => Topic started by: Ruth on April 09, 2023, 01:58:40 am

Title: action profile
Post by: Ruth on April 09, 2023, 01:58:40 am
Hi!

I fear, I found another bug right now by accident. :embarrassed:  Did it not on purpose, Spuds.

If a member, who is not allowed to watch other members profiles yet, clicks on a name, he will see no "warning message".
On my "old forum" there will be a white screen for this member.
On forum in 1.1.9 he will see this error: "Function name must be a string"
Error log says, that there is an error on line 391 in /sources/subs/Menu.subs.php
Title: Re: action profile
Post by: Spuds on May 12, 2023, 10:01:49 pm
Yes that is a bug .... looks like a very old one as well (the white screen was a bug as well)

Honestly those profile links should not be enabled if you can't view the profile, seems a bit silly to supply a link only to respond with a "you can not do that" ... perhaps something for 2.0

For 1.1.x .... in Profile.controller.php
Code: (find) [Select]
		// No menu means no access at all.
if (!$this->_profile_include_data || (isset($this->_profile_include_data['enabled']) && $this->_profile_include_data['enabled'] === false))
Code: (replace) [Select]
		// No menu means no access at all.
if (!$this->_profile_include_data || (isset($this->_profile_include_data['enabled']) && $this->_profile_include_data['enabled'] === false) || !isset($this->_profile_include_data['function']))

I do not think that will have any side effects and will provide the "you can't access that section" message.  Not great but better than nothing!
Title: Re: action profile
Post by: Ruth on May 14, 2023, 12:51:29 am
Yes....it shows an error message now.
This is a lot better than before.

Thank you, Spuds!