Use of undefined constant

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
glon
Posts: 14
Joined: 10 Feb 2014, 06:27

Use of undefined constant

Post by glon »

today my service machine announced many notices about constant, like:

Code: Select all

PHP Notice:  Use of undefined constant ON - assumed 'ON' in /home/nemo/apps/apache2/htdocs/mantis_new/config_inc.php on line 67
PHP Notice:  Use of undefined constant AUTO - assumed 'AUTO' in /home/nemo/apps/apache2/htdocs/mantis_new/config_inc.php on line 113
PHP Notice:  Use of undefined constant STATUS_LEGEND_POSITION_BOTH - assumed 'STATUS_LEGEND_POSITION_BOTH' in /home/nemo/apps/apache2/htdocs/mantis_new/config_inc.php on line 156
but, i could find all these constant in constant_inc.php, my mantisbt version is 1.2.15.

anybody help?

thanks!
Last edited by glon on 14 Feb 2014, 02:17, edited 2 times in total.
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Use of undefined constant

Post by atrol »

Is this a complete new installation or an upgrade?
Does "today my service ...." mean, that all was fine yeseterday?
Please use Search before posting and read the Manual
glon
Posts: 14
Joined: 10 Feb 2014, 06:27

Re: Use of undefined constant

Post by glon »

atrol wrote:Is this a complete new installation or an upgrade?
Does "today my service ...." mean, that all was fine yeseterday?
It's a new installation one, but i've done some changes. And this problem never appeared before.
glon
Posts: 14
Joined: 10 Feb 2014, 06:27

Re: Use of undefined constant

Post by glon »

atrol wrote:Is this a complete new installation or an upgrade?
Does "today my service ...." mean, that all was fine yeseterday?

what would be the probably cause ?
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Use of undefined constant

Post by atrol »

You should upload you config_inc.php (after removing the passwords, ...)
Please use Search before posting and read the Manual
glon
Posts: 14
Joined: 10 Feb 2014, 06:27

Re: Use of undefined constant

Post by glon »

atrol wrote:You should upload you config_inc.php (after removing the passwords, ...)
config_inc.php

Code: Select all

<?php

	$g_hostname = '127.0.0.1:3306';
	$g_db_type = 'mysql';
	$g_database_name = 'database_name';
	$g_db_username = 'username';
	$g_db_password = 'password';
	
	#date_default_timezone_set('PRC');
        $g_default_timezone = 'Asia/Shanghai';

        $g_login_method                         = CRYPT; 

        $g_form_security_validation = OFF;    
	
	$g_rss_enabled = OFF;      

	define("BUG_COUNT_LINK","view_count_bug_page.php");
	define("DOCS_HELP_LINK","");
	define("DOCS_GUIDE_LINK","");

	# ---Email Configuration ---
	$g_phpMailer_method           =2;
	$g_smtp_host                  ='';
	$g_smtp_username              ='';
	$g_smtp_password              ='';
	$g_return_path_email          = '';  # thereturn address for bounced mail
	$g_phpMailer_path             ='./library/phpmailer';
	$g_email_padding_length = 1;
	
	$g_from_email = '';
	
	$g_email_send_using_cronjob = ON;

	//mantis log 
	$g_log_destination = 'file:/home/ll/logs/mantis_mail.log';
	$g_log_level = LOG_EMAIL;
	
	$g_allow_signup = OFF;
	$g_send_reset_password = ON;
    
	$g_delete_bug_threshold = MANAGER;
	$g_create_project_threshold = MANAGER;
	$g_manage_custom_fields_threshold = MANAGER;
	
	$g_update_bug_threshold = REPORTER;  

        $g_update_bug_status_threshold = REPORTER;   

	//Enable or disable usage of the Projection field. 
	$g_enable_projection = ON; 

        $g_allow_no_category = ON;
	
	
	# --- Attachments / File Uploads ---
	$g_allow_file_upload    = ON;
	$g_file_upload_method   = DISK;
	$g_absolute_path_default_upload_folder = '/home/ll/htdocs/mantis_new/upload/';
	#$g_absolute_path_default_upload_folder = $g_absolute_path . 'upload/'; # used with DISK, must contain trailing \ or /.
	$g_max_file_size        = 5000000;  # in bytes
	$g_file_upload_max_num = 5;
	$g_allowed_files        = '';       # extensions comma separated, e.g. 'php,html,java,exe,pl'
	$g_disallowed_files     = '';       # extensions comma separated
	$g_allow_delete_own_attachments = ON;
	
	$g_preview_attachments_inline_max_size = 1024 * 1024;
	$g_preview_max_height = 0;
	
	$g_use_jpgraph = ON;
	$g_jpgraph_path = './jpgraph/src/';
	$g_graph_font = 'simsun';
	$g_system_font_folder = './jpgraph/src/fonts/';
	$g_font_per_captcha = 'simsun.ttf';
	 
	$g_severity_enum_string = '0:None,10:feature,30:text,40:tweak,50:minor,60:major,70:crash';

	$g_status_enum_string  = '10:new,20:feedback,25:feedback2,30:acknowledged,40:confirmed,50:assigned,80:resolved,85:observed,90:closed';
	# Status to assign to the bug when reopened.
	$g_bug_reopen_status2 = FEEDBACK2;
	
	$g_custom_field_type_enum_string    = '0:string,1:numeric,2:float,3:enum,4:email,5:checkbox,6:list,7:multiselection list,8:date,9:enum related,10:checkbox related,11:checkbox related single';	

	$g_show_related_requirment=AUTO;

	$g_reproducibility_enum_string = '10:always,30:sometimes,50:random,90:unable to duplicate';

	$g_priority_enum_string = '20:low,30:normal,40:high,50:urgent,60:immediate';
	
	$g_source_category_enum_string = '5:None,10:customer,15:customer factory,20:test,22:bugfix,25:random test,27:test suggest,29:explore-test,30:dev-test,40:daily build,45:dev-require,50:public test,60:business,70:sync,80:other';
	$g_treat_idea_enum_string = '5:None,10:next test,20:public test,30:public,35:next project,40:future project,50:not resolved';
	
	$g_portal_url = '';
	$g_uapd_host ="";
	$g_pm_mantis_project=$g_uapd_host."/projectmanager/mantis/mantis_pm_mapping";
	$g_pm_requirement_list=$g_uapd_host."/projectmanager/api/requirement/list";
	$g_pm_requirement_change_req_status=$g_uapd_host."/projectmanager/api/requirement/list";
	$g_pm_requirement_change_req_status_key="";
	$g_system_name = '';
	$g_private_key = '';
	
	$g_allow_anonymous_login = ON;
	$g_anonymous_account = '';
	
        $g_status_colors                = array( 'new'          => '#ffa0a0', # red,
                                                 'feedback'     => '#ff50a8', # purple
                                                 'feedback2'    => '#ff5555', # purple
                                                 'acknowledged' => '#ffd850', # orange   
                                                 'confirmed'    => '#ffffb0', # yellow
                                                 'assigned'     => '#c8c8ff', # blue 
                                                 'resolved'     => '#cceedd', # buish-green  
                                                 'observed'     => '#4189dd', # blue 
                                                 'closed'       => '#e8e8e8'); # light gray

	$g_status_legend_position       = STATUS_LEGEND_POSITION_BOTH;
	$g_status_percentage_legend = ON;	
	
	$g_preview_attachments_inline_max_size = 1000000;
	
	$g_show_avatar = ON;	
	$g_show_avatar_threshold = REPORTER;
	
	$g_show_realname = ON;
	
	$g_default_language= 'chinese_simplified';
	
	$g_short_date_format = 'Y-m-d';
	$g_normal_date_format = 'Y-m-d H:i';
	$g_complete_date_format = 'Y-m-d H:i:s';
	
	$g_window_title = '错误跟踪管理系统';
	$g_show_queries_count = OFF;
	$g_show_version = OFF;

        $g_create_permalink_threshold = REPORTER;
	
	$g_time_tracking_enabled = ON;
	$g_time_tracking_with_billing = ON;
	$g_time_tracking_stopwatch = ON;

	# Enable support for bug relationships where a bug can be a related, dependent on, or duplicate of another.
	# See relationship_api.php for more details.
	$g_enable_relationship = ON;	

	$g_reporter_summary_limit       = 20;
	
	$g_default_redirect_delay               = 1;
	    
        $g_bug_report_page_fields = array(
                'category_id',
                'view_state',
                'handler',
                'priority',
                'severity',
                'reproducibility',
                'platform',
                'os',
                'os_version',
                'product_version',
                'product_build',
                'target_version',
                'summary',
                'description',
                'additional_info',
                'steps_to_reproduce',
                'attachments',
                'due_date',
	        
		'source_category', // 'source_category';
        	'treat_idea', // 'treat_idea';
        	'requirement', // 'requirement';
        );

        $g_bug_view_page_fields = array (
                'id',
                'project',
                'category_id',
                'view_state',
                'date_submitted',
                'last_updated',
                'reporter',
                'handler',
                'priority',
                'severity',
                'reproducibility',
                'status',
                'resolution',
                'projection',
                'eta',
                'platform',
                'os',
                'os_version',
                'product_version',
                'product_build',
                'target_version',
                'fixed_in_version',
                'summary',
                'description',
                'additional_info',
                'steps_to_reproduce',
                'tags',
                'attachments',
                'due_date',
                
		'source_category', // 'source_category';
        	'treat_idea', // 'treat_idea';
        	'requirement', // 'requirement';
        );

        $g_bug_print_page_fields = array (
                'id',
                'project',
                'category_id',
                'view_state',
                'date_submitted',
                'last_updated',
                'reporter',
                'handler',
                'priority',
                'severity',
                'reproducibility',
                'status',
                'resolution',
                'projection',
                'eta',
                'platform',
                'os',
                'os_version',
                'product_version',
                'product_build',
                'target_version',
                'fixed_in_version',
                'summary',
                'description',
                'additional_info',
                'steps_to_reproduce',
                'tags',
                'attachments',
                'due_date',
                
	        'source_category', // 'source_category';
        	'treat_idea', // 'treat_idea';
	        'requirement', // 'requirement';
        );

        $g_bug_update_page_fields = array (
                'id',
                'project',
                'category_id',
                'view_state',
                'date_submitted',
                'last_updated',
                'reporter',
                'handler',
                'priority',
                'severity',
                'reproducibility',
                'status',
                'resolution',
                'projection',
                'eta',
                'platform',
                'os',
                'os_version',
                'product_version',
                'product_build',
                'target_version',
                'fixed_in_version',
                'summary',
                'description',
                'additional_info',
                'steps_to_reproduce',
                'attachments',
                'due_date',
	            
        	'source_category', // 'source_category';
	        'treat_idea', // 'treat_idea';
        	'requirement', // 'requirement';
        );

        $g_bug_change_status_page_fields = array (
                'id',
                'project',
                'category_id',
                'view_state',
                'date_submitted',
                'last_updated',
                'reporter',
                'handler',
                'priority',
                'severity',
                'reproducibility',
                'status',
                'resolution',
                'projection',
                'eta',
                'platform',
                'os',
                'os_version',
                'product_version',
                'product_build',
                'target_version',
                'fixed_in_version',
                'summary',
                'description',
                'additional_info',
                'steps_to_reproduce',
                'tags',
                'attachments',
                'due_date',
                
		'source_category', // 'source_category';
        	'treat_idea', // 'treat_idea';
	        'requirement', // 'requirement';
        );

	$g_special_project_ids=array(289,53,741,393,595,566,608,748);
	$g_cat_project_ids = array(289);

?>
glon
Posts: 14
Joined: 10 Feb 2014, 06:27

Re: Use of undefined constant

Post by glon »

atrol wrote:You should upload you config_inc.php (after removing the passwords, ...)
I find a similar questionhttp://www.mantisbt.org/forums/viewtopi ... 331#p26670 .

mine is the same cause ?
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Use of undefined constant

Post by atrol »

These are your error messages

Code: Select all

    PHP Notice:  Use of undefined constant ON - assumed 'ON' in /home/nemo/apps/apache2/htdocs/mantis_new/config_inc.php on line 67
    PHP Notice:  Use of undefined constant AUTO - assumed 'AUTO' in /home/nemo/apps/apache2/htdocs/mantis_new/config_inc.php on line 113
    PHP Notice:  Use of undefined constant STATUS_LEGEND_POSITION_BOTH - assumed 'STATUS_LEGEND_POSITION_BOTH' in /home/nemo/apps/apache2/htdocs/mantis_new/config_inc.php on line 156
But when having a look at lines 67, 113 and 156 I don't see ON, AUTO or STATUS_LEGEND_POSITION_BOTH

I recommend to setup a clean installation of MantisBT and to apply your changes step by step until the problems occurs.

Why do you set options like $g_jpgraph_path?
This option does not exist in MantisBT 1.2.x., this is an obsolete option from older versions.
Run admin/check.php to see that you are using options that do not exist and maybe you will get some other helpful warnings and errors.

You wrote that this is a new installation. I can't believe it is really a new installation.
Please use Search before posting and read the Manual
glon
Posts: 14
Joined: 10 Feb 2014, 06:27

Re: Use of undefined constant

Post by glon »

atrol wrote:These are your error messages

Code: Select all

    PHP Notice:  Use of undefined constant ON - assumed 'ON' in /home/nemo/apps/apache2/htdocs/mantis_new/config_inc.php on line 67
    PHP Notice:  Use of undefined constant AUTO - assumed 'AUTO' in /home/nemo/apps/apache2/htdocs/mantis_new/config_inc.php on line 113
    PHP Notice:  Use of undefined constant STATUS_LEGEND_POSITION_BOTH - assumed 'STATUS_LEGEND_POSITION_BOTH' in /home/nemo/apps/apache2/htdocs/mantis_new/config_inc.php on line 156
But when having a look at lines 67, 113 and 156 I don't see ON, AUTO or STATUS_LEGEND_POSITION_BOTH

I recommend to setup a clean installation of MantisBT and to apply your changes step by step until the problems occurs.

Why do you set options like $g_jpgraph_path?
This option does not exist in MantisBT 1.2.x., this is an obsolete option from older versions.
Run admin/check.php to see that you are using options that do not exist and maybe you will get some other helpful warnings and errors.

You wrote that this is a new installation. I can't believe it is really a new installation.
It's a new installation, but i make some secondary development on it. Just as what I mentioned before: I made some diferences
awicaksi
Posts: 1
Joined: 07 Nov 2014, 12:11

Re: Use of undefined constant

Post by awicaksi »

@glon, you might have your own solution by now, but as I just jumped in to use mantis, I get the similar error message.
My problem went away by adding the case insensitive parameter when defining new status:
define('testdevel', 60, true);
-awicaksi-
Post Reply