Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 4 years ago

#11882 closed defect (bug) (fixed)

get_pending_comments_num has inconsistent behaviour

Reported by: westi Owned by: westi
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Comments Keywords: needs-unit-tests
Focuses: Cc:


You sometimes get and array and sometime not even when you should.

It only return numbers for posts with pending comments.

It needs some tests

Attachments (2)

11882.patch (438 bytes) - added by azaozz 6 years ago.
One more place to clear unneeded code.
11882_tests.patch (1.7 KB) - added by jgadbois 4 years ago.
Unit tests

Download all attachments as: .zip

Change History (9)

comment:1 @westi6 years ago

[12596] - Introduced a bug while trying to fix issues surrounding this before.

Have had reports of notices like:

Warning: number_format() expects parameter 1 to be double, array given in wp-admin/includes/template.php on line 2275

comment:2 @westi6 years ago

(In [12715]) Improve get_pending_comments_num() to be a little more predictable and revert the erroneous change in [12596]. See #11882.

comment:3 @westi6 years ago

  • Keywords needs-unit-tests added

So far I have been manually testing this and I think we have possibly more dead code we can remove.

I also want to write some unit tests for this.

@azaozz6 years ago

One more place to clear unneeded code.

comment:4 @nacin5 years ago

(In [14156]) Remove dead code. props azaozz, see #11882.

comment:5 @nacin5 years ago

  • Status changed from new to assigned

This ticket is all set except for the unit tests.

comment:6 @nacin5 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

Added to new unit tests report.

@jgadbois4 years ago

Unit tests

comment:7 @jgadbois4 years ago

  • Cc jgadbois@… added

I added a simple unit test

Note: See TracTickets for help on using tickets.