View Issue Details

IDProjectCategoryView StatusLast Update
0017263mantisbtbugtrackerpublic2014-12-08 02:08
Reporterdregad Assigned Todregad  
PriorityhighSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.0dev 
Target Version1.3.0-beta.1 
Summary0017263: config_get_global() returns default value for global variables overriden in config_inc.php
Description

While executing the admin checks I noticed a failure on existence of config_inc.php even though the file was present; displaying verbose errors showed a

SYSTEM NOTICE: Undefined variable: t_field_comment
Raised in file /home/dregad/dev/mantisbt/admin/check/check_database_inc.php on line 397

I found that strange since this is mysql-only code and I was configured for postgres.

Tracing shows that config_get_global(db_type) call in db_is_mysql() returns 'mysqli' despite the fact that $g_db_type == 'pgsql' in my config_inc.php

git bisect says the problem is 4b173463c2715c7dfa12dc37b6663df19930e594 (0016850)

TagsNo tags attached.

Relationships

related to 0016850 closedvboctor Add config folder for customization files 

Activities

dregad

dregad

2014-04-28 06:58

developer   ~0040180

This is a blocking issue as it causes failures or unexpected behavior for non-mysql database engines.

dregad

dregad

2014-04-28 07:25

developer   ~0040181

Reminder sent to: vboctor

Victor,

The problem seems to be caused by your moving of config_inc.php's inclusion in core.php until after the initialization of some of the core api's.

Can you explain the rationale behind that ?

Please review proposed fix at https://github.com/mantisbt/mantisbt/pull/170

vboctor

vboctor

2014-04-28 12:00

manager   ~0040188

I've responded to the pull request, thanks Damien.

Related Changesets

MantisBT: master f4989d49

2014-04-28 02:59

dregad


Details Diff
core.php: move config_inc.php include earlier in the file

This fixes a regression introduced by the new config folder commit
4b173463c2715c7dfa12dc37b6663df19930e594: global variables overriden in
config_inc.php are set to their default value in the config cache,
causing config_get_global() to return an incorrect value.

Moving the code to include the config_inc.php file back to its previous
location (immediately after config_defaults_inc.php and before
initializing the various APIs) fixes the problem.

Fixes 0017263
Affected Issues
0017263
mod - core.php Diff File

MantisBT: master 720e823e

2014-04-28 09:45

dregad


Details Diff
Revert crypto_init() to use config_get_global()

Following fix for issue 0017263, it is no longer necessary to rely on use
of global variable.
Affected Issues
0017263
mod - core/crypto_api.php Diff File