Check install script FAIL Corrupted file
Hi Vincent.
Thanks for your excellent work.
I& #039;m using mantis as bugtracker and I& #039;d like to transfer couple of my patches on plugins.
I& #039;m trying to create, for the beginning, a simple & #039;hello world& #039; plugin.
I& #039;ve followed the manual on [ bugtracker.morinie.fr].
The plugin shows on plugins_page.php but when I click on & #039;install now& #039; I get the & #039;Check install script FAIL Corrupted file& #039; .
Could you please give me some hints.
I& #039;m using Mantis-1.1.1 .
Best Regards.
Roman
Hi,
It seems that you forget to provide an install_inc.php file.
Here is an example: click here.
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
Thanks for quick replay.
Non it is not the case.
I have all files as described in [ bugtracker.morinie.fr]
I think about to reduce the code so I can find the where it stucks
Can you post the content of the install_manual_inc.php file?
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
So your plugin is located into plugins/myplugin/ directory?
If yes, make sure that there is no error in the name of the file install_inc.php.
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
The file install_inc.php is in mantis_installation/plugins/my_plugin directory.
The code is copy / paste of => [ bugtracker.morinie.fr]
So change $t_result[& #039;plugin& #039;] = & #039;myplugin& #039;; to $t_result[& #039;plugin& #039;] = & #039;my_plugin& #039;;
I& #039;ve updated the Wiki to explain the $t_result[& #039;plugin& #039;] meaning.
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
Now the message is & #039;Install/Upgrade instructions missing& #039;.
Thanks for the comments on wiki. It makes the procedure much more clear.
Edited 1 time(s). Last edit at 05/11/2008 12:31PM by romanh.
In your install_inc.php file you must have function like this:
function plugins_my_plugin_install_description_plugin( $p_step ) {
and not like this:
function plugins_pluginmanager_install_description_plugin( $p_step ) {
(my_plugin instead of pluginmanager).
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
I& #039;ve changed all the install/upgrade functions :
plugins_my_plugin_install_description_plugin
plugins_my_plugin_upgrade_description_plugin
plugins_my_plugin_install_plugin
plugins_my_plugin_upgrade_plugin
The $t_result[& #039;plugin& #039;] display right the name of my plugin
It doesn& #039;t help. I& #039;m still getting & #039;Install/Upgrade instructions missing& #039;
The following functions are missing:
plugins_my_plugin_install_undo_plugin
plugins_my_plugin_upgrade_undo_plugin
These functions are called if the installation fails (to remove what has already been installed).
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
Shouldn& #039;t all of the patterns & #039;pluginmanager& #039; be changed to my_plugin?
Yes. Here is another example with the plugin Search:
Language: PHP
/**
* Search Engine Plugin
*
*
* Created: 2007-06-08
* Last update: 2008-03-24
*
* @link http://deboutv.free.fr/mantis/
* @author Vincent DEBOUT <deboutv@free.fr>
*/
( ( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_install_page.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, $_SERVER[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;PHP_SELF&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] ) && !ereg( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_uninstall_page.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, $_SERVER[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;PHP_SELF&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] ) ) {
( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;Location: ../../plugins_page.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; );
();
}
$t_plugins_plugin_manager_step_count =();
$t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;install&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] = 1;
$t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;upgrade&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] = 1;
$t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;uninstall&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] = 1;
$t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;mantis_upgrade&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] = 0;
$t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;mantis_repair&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] = 1;
plugins_search_install_description_plugin( $p_step ) {
&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;Add menu link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;
}
plugins_search_upgrade_description_plugin( $p_step ) {
&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;Add menu link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;
}
plugins_search_uninstall_description_plugin( $p_step ) {
&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;Remove menu link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;
}
plugins_search_mantis_upgrade_description_plugin( $p_step ) {
&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;
}
plugins_search_mantis_repair_description_plugin( $p_step ) {
&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;Check menu link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;
}
plugins_search_install_plugin( &$p_msg, $p_step ) {
$p_msg = &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<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_found =;
(( $t_main_menu_custom_options ) &&( $t_main_menu_custom_options ) ) {
( $t_main_menu_custom_options $t_menu_link ) {
( $t_menu_link[0] == &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_search_link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; ) {
$t_found =;
}
}
} {
$t_main_menu_custom_options =();
}
( !$t_found ) {
$t_main_menu_custom_options[] =( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins_search_link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;, VIEWER, &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;plugins/search/search_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 );
PLUGINS_PLUGINMANAGER_OK;
}
plugins_search_upgrade_plugin( &$p_msg, $p_step ) {
plugins_search_install_plugin( &$p_msg, $p_step );
}
plugins_search_install_undo_plugin( &$p_msg, $p_step ) {
$p_msg = &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;
PLUGINS_PLUGINMANAGER_OK;
}
plugins_search_upgrade_undo_plugin( &$p_msg, $p_step ) {
$p_msg = &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;
PLUGINS_PLUGINMANAGER_OK;
}
plugins_search_uninstall_undo_plugin( &$p_msg, $p_step ) {
$p_msg = &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;
PLUGINS_PLUGINMANAGER_OK;
}
plugins_search_uninstall_plugin( &$p_msg, $p_step ) {
$p_msg = &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<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() );
( $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_search_link&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; ) {
( $t_main_menu_custom_options[$i] );
}
}
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 );
PLUGINS_PLUGINMANAGER_OK;
}
plugins_search_mantis_upgrade_plugin( &$p_msg, $p_step ) {
$p_msg = &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;;
PLUGINS_PLUGINMANAGER_OK;
}
plugins_search_mantis_repair_plugin( &$p_msg, $p_step ) {
plugins_search_install_plugin( $p_msg, $p_step );
}
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
Done for :
plugins_my_plugin_upgrade_undo_plugin and plugins_my_plugin_install_undo_plugin
It didn& #039;t help.
It seem& #039;s that there is a bug in the plugin manager.
Can you add this in your install_inc.php file:
Language: PHP $t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;mantis_repair&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] = $t_plugins_plugin_manager_step_count[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;install&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;];
plugins_my_plugin_mantis_repair_description_plugin( $p_step ) {
plugins_my_plugin_install_description_plugin( $p_step );
}
plugins_my_plugin_mantis_repair_plugin( &$p_msg, $p_step ) {
plugins_my_plugin_install_plugin( $p_msg, $p_step );
}
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
Few step before you must have an information of the type of operation: Repair/Install/Upgrade. What do you have? (this is the "Install or Upgrade?" answer)
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
I& #039;ve replaced all the pluginmanager by the name of & #039;my plugin& #039; in all functions. The plugin& #039;s installed without the option & #039;uninstall& #039; and it& #039;s added one more link & #039;Plugins& #039; among the links.
That& #039;s because you didn& #039;t change the content of the install_inc.php file. The install_inc.php file represents what the plugin manager has to do to install the plugin (patch files, patch the database...).
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
Getting there step by step.
I& #039;ve used your example with the plugin Search to build my install_inc.php.
The installation works well and plugin is installed.
The problem is that the “uninstall” link is missing.
When I run manualy the [ myserver] . The plugin is removed (directory included) but the link stays. I& #039;ve got already 5 undelete links .....
I& #039;ve checked the plugin db tables :
mantis_plugins_pm_dependencies_table, mantis_plugins_pm_function_overwrite_table and mantis_plugins_pm_list_table
All references of myplugin has disappeared I have no idea where the links are coming from.
The link appears because of the content of plugins_search_install_plugin function and is removed with the function plugins_search_uninstall_plugin.
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
Online Users
Guests:
8
Record Number of Users:
1
on April 02, 2023
Record Number of Guests:
115
on November 09, 2023
Top Users
|