Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0037379mantisbtplug-inspublic2026-09-09 19:08
ReporterSL-Gundam Assigned Tocommunity  
PrioritylowSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.28.4 
Target Version2.29.0Fixed in Version2.29.0 
Summary0037379: Return value plugin_lang_get_defaulted when no default supplied is incorrect
Description

When you call: plugin_lang_get_defaulted( 'test' );

I would expect when plugin_pluginname_test does not exist that i get 'test' back.
But instead it returns: 'plugin_pluginname_test'

TagsNo tags attached.

Relationships

related to 0026747 closeddregad No equivalent to lang_get_defaulted() in plugin_api() 

Activities

SL-Gundam

SL-Gundam

2026-09-09 15:53

reporter   ~0071428

Currently the workaround is to supply a value for the second parameter: plugin_lang_get_defaulted( 'test', 'test' )
But an easy fix would be: https://github.com/mantisbt/mantisbt/pull/2278

dregad

dregad

2026-09-09 18:21

developer   ~0071429

I would expect when plugin_pluginname_test does not exist that i get 'test' back.

You are correct, this is indeed what should happen - the behavior should match that of lang_get_defaulted().

That's an oversight on my part when I implemented this function (0026747), I did not have a use case for calling the function without a default and so never tested it properly.

Related Changesets

MantisBT: master 5a77ea96

2026-09-09 19:08

SL-Gundam

Committer: community


Details Diff
Fix plugin_lang_get_defaulted() return value

When no default value is supplied, function was returning the fully
qualified plugin string name (i.e. `plugin_<basename>_<name>`) instead
of the expected short language string name ($p_name).

Fixes 0037379, PR https://github.com/mantisbt/mantisbt/pull/2278
Affected Issues
0037379
mod - core/plugin_api.php Diff File