[wp-trac] [WordPress Trac] #53284: `error()` method passed too many parameters
WordPress Trac
noreply at wordpress.org
Thu May 27 08:34:02 UTC 2021
#53284: `error()` method passed too many parameters
--------------------------------------+-----------------------------
Reporter: desrosj | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Upgrade/Install | Version: 3.7
Severity: normal | Resolution:
Keywords: good-first-bug has-patch | Focuses:
--------------------------------------+-----------------------------
Comment (by sainthkh):
I thought about there are 3 possible fixes for this ticket.
1. Call `error` twice.
* Downside: It's usually not called twice.
2. Create a new `WP_Error` object with the first message, `Installation
failed`.
* Downside: It's too complicated.
3. Make `WP_Upgrader_Skin->error` handle multiple arguments.
* Downside: Most error functions in WP only handles one argument. It's
not consistent.
I chose 1. Because it's simple.
The comment said me to add an automated test. But I'm a newbie here and
checked the tests folder and it seems that the tests don't exist for this
class. If I missed something, can you help me write tests for this?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53284#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list