The MediaWiki functions dieUsage() and dieUsageMsg() are both called in Cargo's API classes, but they are both deprecated, in favor of the new function dieWithError(). Unfortunately, Cargo is trying to support a range of MediaWiki versions, so it can't simply switch to calling dieWithError() everywhere. Instead, there should be "if" statements, calling method_exists() to determine which one to call. It may make sense to add a utility function to CargoUtils.php for this, to avoid lots of code duplication.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Switch from dieUsage() to dieWithError() in Cargo | mediawiki/extensions/Cargo | master | +28 -7 |
Related Objects
- Mentioned In
- T184387: Improve the Cargo Special:Drilldown page
Event Timeline
Change 410523 had a related patch set uploaded (by Rosalieper; owner: Rosalieper):
[mediawiki/extensions/Cargo@master] [WIP]Switch from dieUsage() to dieWithError() in Cargo
@Yaron_Koren , looking at @yashdeep97 comment on this task T187115, I found the same piece of code in CargoAutocompleteAPI.php:32. Does it mean this task is invalid as well?
@rosalieper - good catch! No, this task certainly isn't invalid - unless all those other calls to dieUsage() in Cargo have similar code around them. As for this code - I suppose the ideal solution would be to modify it to use the new helper function; although it would also work to just keep this code as it is and not change it.
Hello all I am new member and also interested to work on this project can someone help me out with this.
@Sanjayrajpurohit1996: Hi and welcome. Please see https://www.mediawiki.org/wiki/How_to_become_a_MediaWiki_hacker#Feedback.2C_questions_and_support - thanks!
Change 410523 merged by jenkins-bot:
[mediawiki/extensions/Cargo@master] Switch from dieUsage() to dieWithError() in Cargo