Jump to content

Topic on Extension talk:NumerAlpha

Notice: Undefined index: "full level prefix"

4
Summary last edited by Seb35 20:52, 4 May 2023 1 year ago

Tracked with task T213083. Fixed from f792da2 (2023-05-04) and future REL1_41.

Revansx (talkcontribs)

anyone else seeing the following error:

Notice: Undefined index: full level prefix in /opt/htdocs/mediawiki/extensions/NumerAlpha/NumerAlpha.class.php on line 266

where line 266 of NumerAlpha.class.php is:

return htmlspecialchars( $list['full level prefix'] . $list[ 'prefix' ] . $counterValue . $list[ 'suffix' ] );

Imvuong (talkcontribs)

This works for me.

$fulL_level_prefix = (isset($list['full level prefix'])) ? $list['full level prefix'] : "";

$prefix = (isset($list['prefix'])) ? $list['prefix'] : "";

$suffix = (isset($list['suffix'])) ? $list['suffix'] : "";

return htmlspecialchars( $fulL_level_prefix . $prefix . $counterValue . $suffix);

Seb35 (talkcontribs)

I saw this warning also, and I +1 the fix for full level prefix defaulting to an empty string (it’s the default value defined in extractListOptions), but it’s not necessary to apply the same for prefix and suffix since the only calling functions are renderCounter and render(Numeral|Alpha|Roman)Tag and in both cases these other keys are provided.

Seb35 (talkcontribs)

I wrote a patch here, not exactly like proposed above, but similar: I defined the key 'full level prefix' when the functions are called.