View Issue Details

IDProjectCategoryView StatusLast Update
0022639mantisbtinstallationpublic2017-04-15 10:24
Reporterlbayle2 Assigned Todregad  
PriorityhighSeverityblockReproducibilityalways
Status closedResolutionno change required 
Product Version2.2.1 
Summary0022639: g_db_table_prefix not saved in config_inc.php ?
Description

Hi,
I installed mantisbt-2.2.1.tar.gz

I need a third-party application (CodevTT.org is not a plugin) to get the "db_table_prefix" and "db_table_suffix" which are set at Mantis installation.

what I expect is to find the following variables in config_inc.php :
$g_db_table_prefix = 'fooo';
$g_db_table_suffix = '_baaar';

but they are not defined in the file, and of course, mantis is not working (unless I add the two lines manualy).

Additional Information

I figured out that the config_api.php is used:

Initialize table prefixes as specified by user

    config_set_global( 'db_table_prefix', $f_db_table_prefix );
    config_set_global( 'db_table_plugin_prefix', $f_db_table_plugin_prefix );
    config_set_global( 'db_table_suffix', $f_db_table_suffix );

which then updates the $GLOBALS array.

then, in install.php at ( 5 == $t_install_state ), there is a section :

Add lines for table prefix/suffix if different from default (line 1086)

$t_insert_line = false;
foreach( $t_prefix_defaults['other'] as $t_key => $t_value ) {
    $t_new_value = ${'f_' . $t_key};
    if( $t_new_value != $t_value ) {
        $t_config .= '$g_' . str_pad( $t_key, 25 ) . '= \'' . addslashes( ${'f_' . $t_key} ) . '\';' . PHP_EOL;
        $t_insert_line = true;
    }
}
if( $t_insert_line ) {
    $t_config .= PHP_EOL;
}

but that part of the code seems to not do the work...

TagsNo tags attached.

Activities

lbayle2

lbayle2

2017-04-01 11:53

reporter   ~0056308

Bug seems to be fixed in v2.3.0

dregad

dregad

2017-04-01 18:03

developer   ~0056318

Since you say the problem is gone in 2.3, would you be able to run git bisect to identify the commit that fixed it ?

lbayle2

lbayle2

2017-04-02 08:23

reporter   ~0056325

well git bisect would take a long time as I need to re-install mantis at each step. As the pb is fixed, I admin not having the courrage to do it... sorry.