[wp-trac] [WordPress Trac] #22558: Attachment term counts feels/are inaccurate

WordPress Trac noreply at wordpress.org
Thu Feb 21 14:31:24 UTC 2013


#22558: Attachment term counts feels/are inaccurate
--------------------------+------------------------------
 Reporter:  ocean90       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  2nd-opinion   |
--------------------------+------------------------------
Description changed by ocean90:

Old description:

> For posts:
> * Assign a term to a post, save as draft. Term count returns 0.
> * Publish the post. Term count returns 1.
> * Change post status back to draft. Term count returns 0.
>
> For attachments:
> * Upload an image, assign a term. Term count returns 0.
> * Create a new post and insert the image in a published post. Term count
> returns 0.
> * Create a new post, use the insert media modal and upload an image. Then
> go the the media edit screen and assign a term to the image. Term count
> returns 1.
> * Change the post status back to draft. Term count returns 1.
> * Upload an image, assign a term, attach the attachment to a published
> post. Term count returns 0.
>
> The default term update callback is `_update_post_term_count`. The
> function includes a special case for attachments, that's the reason why
> we have the 1 in step 3.
>
> IMO the term count for attachments shouldn't rely on the parent post
> status. We should just force `_update_generic_term_count`.
>
> Also noted here: https://core.trac.wordpress.org/ticket/21391#comment:41

New description:

 For posts:
 * Assign a term to a post, save as draft. Term count returns 0.
 * Publish the post. Term count returns 1.
 * Change post status back to draft. Term count returns 0.

 For attachments:
 * Upload an image, assign a term. Term count returns 0.
 * Create a new post and insert the image in a published post. Term count
 returns 0.
 * Create a new post, use the insert media modal and upload an image. Then
 go the the media edit screen and assign a term to the image. Term count
 returns 1.
 * Change the post status back to draft. Term count returns 1.
 * Upload an image, assign a term, attach the attachment to a published
 post. Term count returns 0.

 The default term update callback is `_update_post_term_count`. The
 function includes a special case for attachments, that's the reason why we
 have the 1 in step 3.

 IMO the term count for attachments shouldn't rely on the parent post
 status. We should just force `_update_generic_term_count`.

 Also noted here: comment:ticket:21391:41

--

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22558#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list