Make WordPress Core

Opened 15 years ago

Closed 14 years ago

Last modified 13 years ago

#11882 closed defect (bug) (fixed)

get_pending_comments_num has inconsistent behaviour

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

Description

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 15 years ago.
One more place to clear unneeded code.
11882_tests.patch (1.7 KB) - added by jgadbois 13 years ago.
Unit tests

Download all attachments as: .zip

Change History (9)

#1 @westi
15 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

#2 @westi
15 years ago

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

#3 @westi
15 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.

@azaozz
15 years ago

One more place to clear unneeded code.

#4 @nacin
14 years ago

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

#5 @nacin
14 years ago

  • Status changed from new to assigned

This ticket is all set except for the unit tests.

#6 @nacin
14 years ago

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

Added to new unit tests report.

@jgadbois
13 years ago

Unit tests

#7 @jgadbois
13 years ago

  • Cc jgadbois@… added

I added a simple unit test

Note: See TracTickets for help on using tickets.