View Issue Details

IDProjectCategoryView StatusLast Update
0004056mantisbtcustom fieldspublic2004-07-18 11:34
Reporterfman Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Versiongit trunk 
Fixed in Version0.19.0a2 
Summary0004056: Displaying/Reporting Issue -> Application Warning - lang_exists() missing arg 2
Description

When displaying or reporting an issue tha has custom fields
I get the application warning.

Reason: in function lang_get_defaulted, lang_exists is called without the second argument.

Fix:
old :
function lang_get_defaulted( $p_string, $p_default = null ) {
if ( lang_exists( $p_string) ) {

fixed:
function lang_get_defaulted( $p_string, $p_default = null ) {
if ( lang_exists( $p_string) ) {

TagsNo tags attached.

Activities

fman

fman

2004-07-09 04:25

reporter   ~0005952

Typo Error in fixed:
fixed:
function lang_get_defaulted( $p_string, $p_default = null ) {
if ( lang_exists( $p_string,$p_default) ) {

vboctor

vboctor

2004-07-10 10:36

manager   ~0005970

Following is the new implementation for the method:

function lang_get_defaulted( $p_string, $p_default = null, $p_lang = null ) {
$t_lang = $p_lang;

if ( NULL == $t_lang ) {
    $t_lang = lang_get_default();
}

if ( 'auto' == $t_lang ) {
    $t_lang = lang_map_auto();
}

# Now we'll make sure that the requested language is loaded
lang_ensure_loaded( $t_lang );

if ( lang_exists( $p_string, $t_lang ) ) {
    return lang_get( $p_string );
} else {
    if ( null === $p_default ) {
        return $p_string;
    } else {
        return $p_default;
    }
}

}

Related Changesets

MantisBT: master b5ef270c

2004-07-10 11:38

vboctor


Details Diff
Fix 0004056: Displaying/Reporting Issue -> Application Warning - lang_exists() missing arg 2 (vboctor)

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2682 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0004056
mod - doc/ChangeLog Diff File
mod - core/lang_api.php Diff File