Since og statistics has hard coded logic whether to increase member/comment/post count.

However, if you're running any complex site with any sort of custom workflows (like if want stats to just include workflow.module published nodes, or member count not include test users), or want to hide information from generic stats, unable to.

So my idea is to

  • Switch over to recalculating on update/insert -- this is what node comment statistics does, so it's not an unusual pattern. With everything in one place it'll hopefully be easier to maintain, though there is a (minimal?) performance impact
  • For the base case, add in comment/node published settings

Haven't got a patch yet, but threw up a sandbox at https://github.com/hefox/og_statistics-sandbox--working-on-patch- (not using d.o sandboxes for patches till can delete them).

Comments

hefox’s picture

StatusFileSize
new36.14 KB

Here's the first rather try.

It probably has some coding style issues, specially in relation to the tests and t function, but not sure the best standards there so need to look into that.

Sorry for such a big patch.

hefox’s picture

Status: Active » Needs review
hefox’s picture

StatusFileSize
new36.22 KB

Updated patch (hopefully)