• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Admin Tool to Rebuild post attach_count for all posts based on actual number of attachments

rfc0001

Active member
#1
Would be nice to have Admin > Tools > Rebuild (admin.php?tools/rebuild) option to rebuild all post attach_counts based on actual # of attachments associated with post id.
 

Jake B.

Well-known member
#2
Realistically this seems like a really specific issue to have, would probably be better to include this as an option on the rebuild thread job or something similar. Assuming add-ons use the attachment handler (which they should 100% of the time) this is a non issue and will never happen, the issue only comes into play when something improperly inserts or removes data from attachment tables
 

Jake B.

Well-known member
#4
Might make sense to have it rebuild attachment counts when post positions are rebuilt within the rebuild threads job, but as a completely separate standalone option doesn't seem all that useful
 

ozzy47

Well-known member
#5
Might make sense to have it rebuild attachment counts when post positions are rebuilt within the rebuild threads job, but as a completely separate standalone option doesn't seem all that useful
It would only be useful if some third party source messed up the database as you said earlier.
 

Jake B.

Well-known member
#7
That add-on still just runs a single query to update everything, I definitely wouldn't recommend running it if you have a large number of posts.