Fixed Undefined index: lastBuilt in src/XF/Pub/App.php on line 318

Affected version
2.0.x, 2.1.x

AddonsLab

Well-known member
Hello,

The error mentioned above can be seen when \XF\Repository\ApprovalQueue::rebuildUnapprovedCounts method is called to populate unapproved post count in the session. We could not reproduce this by built-in XenForo actions, but it happens in our Guest Posting product, and reviewing the code the reason seems to be from the method mentioned. If unapprovedCounts key is empty it is being populated with the cache containing keys total and lastModified. These are the expected keys in unapprovedCounts registry entry but are invalid for $session->unapprovedCounts. It should have lastBuilt key instead of lastModified, as can be seen in App.php on line 318.

Please let us know if you think this is indeed a bug. For now, we will extend the method to correct session entry for our product not to give the error.

Thank you!
 

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.2).

Change log:
Populate the session with the correct cache keys for unapproved counts.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Top