Fixed News feed handler does not check if the content exists before adding attachments

TickTackk

Well-known member
Affected version
2.1.7
Calling getContent() on XF:NewsFeed entity will throw this exception
Code:
ErrorException: [E_WARNING] Invalid argument supplied for foreach() src/XF/Repository/Attachment.php:198
if the content does not exist.
 
Method addAttachments in news feed handler also passes entity to \XF\Repository\Attachment::addAttachmentsToContent without turning entity into array collection and back to entity.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.1.8).

Change log:
Improve news feed handler attachment handling
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom