Mantis

Plugin Link displays multiple times

Posted by rhutchinson 
Plugin Link displays multiple times
November 06, 2007 10:39PM
I had some issues installing the plugin manager (user error) and apparently installed it multiple times. Now, the "plugins" link appears across the top of the page 3 times.

I've tried to update the main_menu_custom_options entry in the mantis_config_table table to remove the 2nd two links to no avail.

When I change that value I get the error: "SYSTEM WARNING: Invalid argument supplied for foreach()" at the top of each page.

What do I need to change to make the two extra links go away?
Re: Plugin Link displays multiple times
November 06, 2007 10:55PM
If in the database you have only 'Plugins' link for the menu, you can remove the entry.

Then create a file named patch.php in the mantis root directory and add this in it:
Language: PHP
( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;core.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; );   $t_main_menu_custom_options = config_get( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;main_menu_custom_options&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, array() ); $t_main_menu_custom_options[] =( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_pluginmanager_link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, ADMINISTRATOR, &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_page.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; ); config_set( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;main_menu_custom_options&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, $t_main_menu_custom_options );  

Browse the file (patch.php) with your favorite internet browser (just one time).

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Plugin Link displays multiple times
November 14, 2007 10:31PM
Hi,
I am having the same problem but the patch did not seem to do anything. Where should I be looking to remove the extra links? Thanks.

Mantis 1.0.8

TIA,
Shinan
Re: Plugin Link displays multiple times
November 14, 2007 10:39PM
This one will be better:
Language: PHP
( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;core.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; );   $t_main_menu_custom_options = config_get( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;main_menu_custom_options&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, array() ); span class="br0">( $i=0; $i<count( $t_main_menu_custom_options ); $i++ ) { ( $t_main_menu_custom_options[$i][0] == &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_pluginmanager_link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; ) { ( $t_main_menu_custom_options[$i] ); } }   $t_main_menu_custom_options[] =( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_pluginmanager_link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, ADMINISTRATOR, &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_page.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; ); config_set( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;main_menu_custom_options&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, $t_main_menu_custom_options );  

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here



Edited 1 time(s). Last edit at 11/10/2008 12:00PM by deboutv.
Re: Plugin Link displays multiple times
November 14, 2007 11:15PM
Thanks for the quick reply but mine must have been really messed up. I had to modify the code for it to work in my particular scenario. My array keys did not start at 0 so the for loop would not work correctly:

<?php
 
require_once( &#039;core.php&#039; );
 
$t_main_menu_custom_options = config_get( &#039;main_menu_custom_options&#039;, array() );
//for( $i=0; $i<count( $t_main_menu_custom_options ); $i++ ) {
foreach($t_main_menu_custom_options as $key=>$value) {
    if ( $value[0] == &#039;plugins_pluginmanager_link&#039; ) {
		unset( $t_main_menu_custom_options[$key] );
    }
}
 
$t_main_menu_custom_options[] = array( &#039;plugins_pluginmanager_link&#039;, ADMINISTRATOR, &#039;plugins_page.php&#039; );
config_set( &#039;main_menu_custom_options&#039;, $t_main_menu_custom_options );
 
?>



Edited 1 time(s). Last edit at 11/14/2007 11:15PM by skassam.
Sorry, only registered users may post in this forum.

Click here to login



Online Users

Guests: 16
Record Number of Users: 1 on April 02, 2023
Record Number of Guests: 115 on November 09, 2023
Top Users
Hébergeur : Morinie.Fr