Opened 15 years ago
Closed 15 years ago
#11530 closed defect (bug) (fixed)
logic errors in clean_term_cache()
Reported by: | Denis-de-Bernardy | Owned by: | westi |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
clean_term_cache() has a completely random behaviour.
the attached patch ensures that it behaves consistently.
Attachments (1)
Change History (10)
#2
@
15 years ago
- Description modified (diff)
- Owner changed from filosofo to westi
- Status changed from new to accepted
Have you got some example plugin code we can use to test this and reproduce the issue so that more people can test the fix?
#3
@
15 years ago
Can you also explain which part is the Complelely random section? I'm guessing its the Action args?
Also, What was the point of this over the original, It doesnt add anything extra..
$taxonomies = array($taxonomy); foreach ( $taxonomies as $taxonomy ) { foreach ( $ids as $id ) { wp_cache_delete($id, $taxonomy); } }
#4
@
15 years ago
@westi: no working example, I merely ran into it while looking into improving a flush() function for memcached. please look at the code as it currently is.
the clean_terms_cache() accepts term_ids or term_taxonomy_ids as the first argument, and a taxonomy or an array of taxonomies as the second argument. use cases:
- one taxonomy provided, array of t_ids given. it does exactly what it should, i.e. deletes the cache properly, and ends up calling:
do_action('clean_term_cache', $t_ids, $taxonomy);
- no taxonomy provided, array of tt_ids given. it deletes the cache properly, but ends up calling the clean_term_cache action with tt_ids:
do_action('clean_term_cache', $tt_ids, $last_taxonomy_looped);
- multiple taxonomies provided, array of t_ids given. then this deletes nothing (it's an invalid bucket):
wp_cache_delete($id, $taxonomy);
and the concluding do_action amounts to:
do_action('clean_term_cache', $t_ids, $last_taxonomy_looped);
#7
@
15 years ago
- Milestone changed from 2.9.1 to 3.0
Setting the milestone to 3.0 for now as that is where the changes so far have been committed.
see also #11531