user_pref_get_language()

Get help from other users here.

Moderators: Developer, Contributor

Ricounet
Posts: 1
Joined: 26 Sep 2009, 17:16

user_pref_get_language()

Post by Ricounet »

Greetings

I've installed mantisbt-1.2.0rc1 to my webhost server for testing purpose.
After updating the PHP version from 4 to 5, I succesfully set up the database connection. Then I went to the login page and all I got is an error message:

Fatal error: Call to undefined function user_pref_get_language() in d:\www\....\core\relationship_api.php on line 79
PHP Fatal error: Call to undefined function user_pref_get_language() in d:\www\....\core\relationship_api.php on line

I'm not used to PHP :roll:, so I don't know if it's a basic PHP function. If not, within which file is this function defined?

Eric.
spaceout
Posts: 3
Joined: 12 Oct 2009, 11:23

Re: user_pref_get_language()

Post by spaceout »

I'm getting exactly the same error

Fatal error: Call to undefined function user_pref_get_language() in c:\Inetpub\wwwroot\mantis\core\relationship_api.php on line 79

This is on Windows running IIS 6 with the PHP extension.

Strangely, it works just fine on my test setup which is running on XAMPP.

HELP!!
spaceout
Posts: 3
Joined: 12 Oct 2009, 11:23

Re: user_pref_get_language()

Post by spaceout »

I get the same error with 1.20rc1 and rc2.
Cort
Posts: 2
Joined: 14 Oct 2009, 02:26

Re: user_pref_get_language()

Post by Cort »

I just tried upgrading my 1.1.7 version to 1.2.0rc2 and got this same error. I didn't seem to find this in other places from google, so hopefully it is just something that we are missing and not much of a problem.
pskiwi
Posts: 2
Joined: 25 Feb 2010, 15:21

Re: user_pref_get_language()

Post by pskiwi »

Maybe this is a problem of an old PHP version.
Changing all 'var's to 'public' in BugRelationData solved the problem for me (PHP 5.1.2).
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: user_pref_get_language()

Post by atrol »

Does this mean that you have the first mentioned problem (user_pref_get_language) reproducible with current 1.2.0 and are able to solve this by changing var to public?
If yes, please enter an issue for it in MantisBT's own tracker
Please use Search before posting and read the Manual
pskiwi
Posts: 2
Joined: 25 Feb 2010, 15:21

Re: user_pref_get_language()

Post by pskiwi »

Correct, after updating from 1.1 to 1.2 I had the undefined function error.
After commenting out some code, I verified that the keyword 'var' caused this strange behaviour.
'var' seems to be deprecated in PHP5.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: user_pref_get_language()

Post by atrol »

thanks for entering the issue
hint for others to track this
http://www.mantisbt.org/bugs/view.php?id=11584
Please use Search before posting and read the Manual
elo
Posts: 2
Joined: 04 Mar 2010, 21:58

Re: user_pref_get_language()

Post by elo »

pskiwi wrote:Maybe this is a problem of an old PHP version.
Changing all 'var's to 'public' in BugRelationData solved the problem for me (PHP 5.1.2).
Getting the same error defined in posts above..

Can you describe, with more detail, how you resolved the issue? Where's "BugRelationData"? Is it a file or a section in a configuration file?

thanks much,
elo
elo
Posts: 2
Joined: 04 Mar 2010, 21:58

Re: user_pref_get_language()

Post by elo »

pskiwi wrote:Maybe this is a problem of an old PHP version.
Changing all 'var's to 'public' in BugRelationData solved the problem for me (PHP 5.1.2).
I'm receiving the same error detailed above in previous posts..

Can you describe, in more detail, how you resolved the issue? (i.e. where's "BugRelationData"? is it a file, or a section in a config file?)

thanks much
elo
javer
Posts: 1
Joined: 16 Mar 2010, 22:27

Re: user_pref_get_language()

Post by javer »

Hi,

I also had this problem ...

if looking for quick solution:

1) change "core/relationship_api.php"
- change 'var' to 'public' in class 'BugRelationshipData'

2) find all lines with 'user_pref_get_language' - "core/lang_api.php"
and add second parameter value 'ALL_PROJECTS' if not exist

example:
found:

Code: Select all

$t_lang = user_pref_get_language( auth_get_current_user_id() );
change to:

Code: Select all

$t_lang = user_pref_get_language( auth_get_current_user_id(), ALL_PROJECTS );
3) find all lines with 'user_pref_get_language' - "core/email_api.php"
and repeat second step

everything works without other problems
nprlisner
Posts: 1
Joined: 24 Jun 2010, 00:47

Re: user_pref_get_language()

Post by nprlisner »

Had the same problem after upgrading today. I used a new directory for the fresh install. Upgraded Mantis version 1.0.7 to 1.2.1 and got the following error after first launch:

[23-Jun-2010 20:03:17] PHP Fatal error: Call to undefined function user_pref_get_language() in c:\Inetpub\wwwroot\mantisbtNew\core\relationship_api.php on line 79

Found the fix here by just changing some private vars to public. Changed var to public in the BugRelationshipData class in file core/relationship_api.php

class BugRelationshipData {
var $id;
var $src_bug_id;
var $src_project_id;
var $dest_bug_id;
var $dest_project_id;
var $type;
}

TO:

class BugRelationshipData {
public $id;
public $src_bug_id;
public $src_project_id;
public $dest_bug_id;
public $dest_project_id;
public $type;
}

I did not perform step 2 as mentioned in the previous post. Mantis seems to be working fine now.
caro
Posts: 11
Joined: 14 Jun 2013, 12:05

Re: user_pref_get_language()

Post by caro »

Hi, I have the same problem as described in previous posts:

Code: Select all

PHP Fatal error:  Call to undefined function user_pref_get_language() in /home/mantis/mantisbt-1.2.8/core/lang_api.php on line 104, referer: https://mantis.s4a.aero/mantis/manage_plugin_page.php
I tried to do all described steps but still I've got the same error. I added ALL_PROJECTS as second parameter into function in lang_api.php file but it does't change anything.
I have mantis 1.2.8 version, PHP 5.2.9 version and mantis working on apache server. Any ideas what can be wrong?
Thanks in advance for your help.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: user_pref_get_language()

Post by atrol »

caro,
are you able to reproduce the issue on the same server with a fresh installation of latest stable version of MantisBT (1.2.15 at the moment)?
Please use Search before posting and read the Manual
caro
Posts: 11
Joined: 14 Jun 2013, 12:05

Re: user_pref_get_language()

Post by caro »

I'm afraid not, cause this is company server and I cannot to release new mantis versions on it. But I forgot to admit that I have 2 other mantises on this server (the same bugtracker versions) and they work correctly! There was some changes in this mantis code but same as in these 2 other mantises. So, it's really strange error for me...
Post Reply