WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20703 closed defect (bug) (fixed)

wp.getComments logs in the user (1 + #comments) times

Reported by: aercolino Owned by: ryan
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.3.2
Component: XML-RPC Keywords: has-patch commit
Focuses: Cc:

Description

Also wp.getPages had a similar bug, before [20807].

I've been writing an enhancement for my LoginDongle plugin, where I will use a query string param to allow an XML-RPC user to log in. All calls work fine except getComments and it's because it reuses the getComment() method, which causes the unneeded logins.

getComments issue
|
getPages issue

Attachments (1)

20703.patch (4.5 KB) - added by maxcutler 2 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 aercolino2 years ago

  • Cc cappuccino.e.cornetto@… added

maxcutler2 years ago

comment:2 maxcutler2 years ago

  • Cc max@… added
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.4

Added a patch that moves the formatting logic out into a _prepare_comment method like we've done for all other content types in the 3.4 release. Also fixes a potential source of notices if the caller omits the optional fourth argument.

Added some unit tests for these two methods in [UT720].

comment:3 nacin2 years ago

  • Keywords commit added

comment:4 westi2 years ago

Looks good to me too.

comment:5 ryan2 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [20856]:

Introduce _prepare_comment(). Avoid repeated auth attempts. Props maxcutler. fixes #20703

comment:6 aercolino2 years ago

Thanks :-)

Note: See TracTickets for help on using tickets.