Fixed Approval queue

Brilliant stuff -
I can apply the patch and test it !
Currently theres an alpha of 2.1.5 - i presume this will make its way into the final release ?
 
Last edited:
2.1.5a is the current release. The "a" denotes that it is a post-release patch, rather than an alpha.

It's safe to upgrade to it, but this particular fix won't appear until XF 2.1.6.
 
Hi,
I've applied the patch and tried this on one of our test servers - this is what im seeing !
Posts + Threads = 866
Approval Queue = 858

It doesnt feel like this patch is working as intended .

Let me know if you want me to check or test something else ?

Thanks


I gave this patch a go 2ndattempt.webp
 
So i've had a poke around in the code and it looks like the following line in updateModeratorCounts
is affecting the count at the top of the page.

$unapprovedItems = $approvalQueueRepo->filterViewableUnapprovedItems($unapprovedItems);

Commenting out causes the numbers to add-up correctly .
Not sure which count should be showing though.

So still need an official fix

Cheers

N
 
Last edited:
Where are your count of posts and threads coming from?

If that is a simple SELECT COUNT(*) FROM xf_approval_queue WHERE content_type = 'post|thread' then this wouldn't be accurate.

The line you have commented out takes into consideration the items that the logged in user can actually view and action.

The discrepancy may be because the currently logged in user is not able to see or action some of the items of content. For example, the post or thread may be in a forum that the logged in user doesn't have permission to view, or permission to approve/unapprove items in.

So, based on what you've said so far, my hunch is that the fix is correct.
 
Actually, just to help you get to the bottom of it, please edit the file and replace:

PHP:
$unapprovedItems = $approvalQueueRepo->filterViewableUnapprovedItems($unapprovedItems);

With:

PHP:
$viewableUnapproved = $approvalQueueRepo->filterViewableUnapprovedItems($unapprovedItems);

$diff = array_diff($unapprovedItems->toArray(), $viewableUnapproved->toArray());

\XF::dump($diff);

$unapprovedItems = $viewableUnapproved;

This should dump out the difference of the original list, and the filtered list. From that, you may be able to ascertain why those entries get filtered out.

You'll need to trigger the session cache to rebuild, perhaps by logging out and logging back in. Keep an eye out for the dump appearing at the top of the page (the code will probably only be called once before the count is cached).
 
Top Bottom