Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#34896 closed defect (bug) (fixed)

Prevent unnecessary $wpdb->update() when hierarchical post doesn't have children

Reported by: danielbachhuber's profile danielbachhuber Owned by: joehoyle's profile joehoyle
Milestone: 4.5 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch has-unit-tests commit
Focuses: Cc:

Description

Includes tests for reassignment behavior when deleting a hierarchical post, which I couldn't find in our test suite.

Attachments (2)

34896.1.diff (1.9 KB) - added by danielbachhuber 9 years ago.
34896.2.diff (1.9 KB) - added by danielbachhuber 9 years ago.

Download all attachments as: .zip

Change History (5)

#1 @joehoyle
9 years ago

Looks good, as noted in Slack, the count I think is superfluous, checking the result from get_results is falsy should be fine.

Last edited 9 years ago by joehoyle (previous) (diff)

#2 @danielbachhuber
9 years ago

  • Keywords commit added

Updated patch to remove count() call

#3 @joehoyle
9 years ago

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

In 35817:

Prevent unnecessary $wpdb->update() when hierarchical post doesn't have children.

Props danielbachhuber.
Fixes #34896.

Note: See TracTickets for help on using tickets.