Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.

RemoveLink

edited July 2011 in Feedback
After some frustration attempting to remove certain sidebar menu items from the profile page, I believe I may have discovered a bug in the RemoveLink function of the SideMenuModule.

Before:

public function RemoveLink($Group, $Text) {
if (array_key_exists($Group, $this->Items) && is_array($this->Items[$Group])) {
foreach ($this->Items[$Group] as $Index => $GroupArray) {
if ($this->Items[$Group][$Index]['Text'] == $Text) {
unset($this->Items[$Group][$Index]);
array_merge($this->Items[$Group]);
break;
}
}
}
}
After:

public function RemoveLink($Group, $Text) {
if (array_key_exists($Group, $this->Items) && is_array($this->Items[$Group])) {
foreach ($this->Items[$Group]['Links'] as $Index => $GroupArray) {
if ($this->Items[$Group]['Links'][$Index]['Text'] == $Text) {
unset($this->Items[$Group]['Links'][$Index]);
array_merge($this->Items[$Group]['Links']);
break;
}
}
}
}
I added ['Links'] after each occurrence of $this->Items[$Group]. Perhaps the structure of the SideMenu object was changed at some point and not updated here?

2.0.17.8

Cheers,
Chris
Tagged:

Comments

Sign In or Register to comment.