Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 872281 - Various deprecation warnings for MediaWiki 1.35 - that may lead to breakage in future MediaWiki upgrade
Summary: Various deprecation warnings for MediaWiki 1.35 - that may lead to breakage i...
Status: CONFIRMED
Alias: None
Product: Websites
Classification: Unclassified
Component: Wiki (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Wiki Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-22 04:53 UTC by Jon Robson
Modified: 2023-07-07 07:38 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Robson 2022-09-22 04:53:29 UTC
Hello, I am a mediawiki developer. This is a bug for the wiki skin in 1.35.

Deprecated: Use of BaseTemplate::makeSearchInput was deprecated in MediaWiki 1.35. [Called from TyrianTemplate::searchBox in skins/Tyrian/TyrianTemplate.php at line 211] i

Deprecated: Use of BaseTemplate::getFooterIcons was deprecated in MediaWiki 1.35. [Called from TyrianTemplate::footer in /Users/jrobson/git/core/skins/Tyrian/TyrianTemplate.php at line 147] in /Users/jrobson/git/core/includes/debug/MWDebug.php on line 381


Warning: Undefined variable $footerEnd in /Users/jrobson/git/core/skins/Tyrian/TyrianTemplate.php on line 190

<b>Deprecated</b>:  Use of BaseTemplate::makeListItem was deprecated in MediaWiki 1.35. [

<b>Deprecated</b>:  Use of BaseTemplate::getPersonalTools was deprecated in MediaWiki 1.35. 


The recommendation here is to use the associated skin methods e.g. Skin::makeSearchInput

I also recommend removing the call to `Wikimedia\AtEase\AtEase::suppressWarnings();` so that warnings are more noticeable as you upgrade MediaWiki version - it suppresses these warnings from your logs!

Please me know if you would like a patch for this.
Comment 1 Brian Evans (RETIRED) gentoo-dev 2022-09-22 13:07:42 UTC
(In reply to Jon Robson from comment #0)
> Hello, I am a mediawiki developer. This is a bug for the wiki skin in 1.35.
> 
> Deprecated: Use of BaseTemplate::makeSearchInput was deprecated in MediaWiki
> 1.35. [Called from TyrianTemplate::searchBox in
> skins/Tyrian/TyrianTemplate.php at line 211] i
> 
> Deprecated: Use of BaseTemplate::getFooterIcons was deprecated in MediaWiki
> 1.35. [Called from TyrianTemplate::footer in
> /Users/jrobson/git/core/skins/Tyrian/TyrianTemplate.php at line 147] in
> /Users/jrobson/git/core/includes/debug/MWDebug.php on line 381
> 
> 
> Warning: Undefined variable $footerEnd in
> /Users/jrobson/git/core/skins/Tyrian/TyrianTemplate.php on line 190
> 
> <b>Deprecated</b>:  Use of BaseTemplate::makeListItem was deprecated in
> MediaWiki 1.35. [
> 
> <b>Deprecated</b>:  Use of BaseTemplate::getPersonalTools was deprecated in
> MediaWiki 1.35. 
> 
> 
> The recommendation here is to use the associated skin methods e.g.
> Skin::makeSearchInput
> 
> I also recommend removing the call to
> `Wikimedia\AtEase\AtEase::suppressWarnings();` so that warnings are more
> noticeable as you upgrade MediaWiki version - it suppresses these warnings
> from your logs!
> 
> Please me know if you would like a patch for this.

Some of the suggested fixes are incorrect as written.

With 1.35.7 that we are currently running now, in that version's Skin class, the makeSearchInput and makeListItem are not static and accesses $this in places.  This is a code violation to change at this time. getPersonalToolsForMakeListItem is not marked static, but does not access $this.  The deprecation is incomplete upstream.

This will be reviewed for 1.39 upgrade in the future where things look much different in Skin and SkinTemplate classes.

The getFooterIcons call is being replaced by the same code inline.
Comment 2 Brian Evans (RETIRED) gentoo-dev 2022-09-22 13:20:51 UTC
(In reply to Brian Evans from comment #1)
> 
> Some of the suggested fixes are incorrect as written.
> 
> With 1.35.7 that we are currently running now, in that version's Skin class,
> the makeSearchInput and makeListItem are not static and accesses $this in
> places.  This is a code violation to change at this time.
> getPersonalToolsForMakeListItem is not marked static, but does not access
> $this.  The deprecation is incomplete upstream.
> 
> This will be reviewed for 1.39 upgrade in the future where things look much
> different in Skin and SkinTemplate classes.
> 
> The getFooterIcons call is being replaced by the same code inline.

After thinking a bit more, is the intension to just copy the $this->getSkin()->$function from BaseTemplate now and then, possibly change again for 1.39?

I think we would just rather hold off for that time since nothing is affected now.

Thanks for the notice for when we upgrade.
Comment 3 Jon Robson 2022-09-22 15:46:15 UTC
> Some of the suggested fixes are incorrect as written.
Can you expand on this?

> With 1.35.7 that we are currently running now, in that version's Skin class, the makeSearchInput and makeListItem are not static and accesses $this in places.  This is a code violation to change at this time. getPersonalToolsForMakeListItem is not marked static, but does not access $this.
I'm a bit confued here. These are not static methods (note MediaWiki deprecation warnings says "Use of BaseTemplate::makeListItem" but that doesn't mean makeListItem is static)

where you do $this->makeListItem inside TyrianTemplate you need to replace that with $this->getSkin()->makeListItem to avoid future breakage. That should be perfectly safe to do in 1.35.7
Comment 4 Larry the Git Cow gentoo-dev 2023-07-07 07:38:21 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/sites/wiki/skin-tyrian.git/commit/?id=f061d96a6bcdb9bc8c4ad66ee9f229e0b00f5cec

commit f061d96a6bcdb9bc8c4ad66ee9f229e0b00f5cec
Author:     Brian Evans <grknight@gentoo.org>
AuthorDate: 2022-09-22 13:10:01 +0000
Commit:     Brian Evans <grknight@gentoo.org>
CommitDate: 2022-09-22 13:10:01 +0000

    Remove warnings and deprecation in footer
    
    Bug: https://bugs.gentoo.org/872281
    Signed-off-by: Brian Evans <grknight@gentoo.org>

 TyrianTemplate.php | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)