MG 1.1 Server error on media with more than one like...

thumped

Well-known member
i've a problem on any media in Xenforo Media Gallery that's received more than one like

Code:
An exception occurred: Argument 4 passed to XenForo_Template_Helper_Core::helperLikesHtml() must be of the type array, boolean given, called in /home/thumped/public_html/bbs/library/XenForo/Template/Helper/Core.php on line 853 in /home/thumped/public_html/bbs/library/XenForo/Template/Helper/Core.php on line 411

XenForo_Template_Helper_Core::helperLikesHtml() in XenForo/Template/Helper/Core.php at line 853
XenForo_Template_Helper_Core::callHelper() in /home/thumped/public_html/bbs/internal_data/templates/S.16,L.1,xengallery_media_view.php at line 1716
include() in XenForo/Template/Abstract.php at line 260
XenForo_Template_Abstract->_renderInternal() in XenForo/Template/Abstract.php at line 191
XenForo_Template_Abstract->render() in XenForo/Template/Public.php at line 110
XenForo_Template_Public->render() in XenForo/ViewRenderer/HtmlPublic.php at line 124
XenForo_ViewRenderer_HtmlPublic->renderContainer() in XenForo/FrontController.php at line 639
XenForo_FrontController->renderView() in XenForo/FrontController.php at line 158
XenForo_FrontController->run() in /home/thumped/public_html/bbs/index.php at line 13
deleting all entries for the xengallery_media content type from the xf_liked_content table hasn't helped... i'm using dark nothing's post ratings add on, but disabling it doesn't help.
 

Chris D

XenForo developer
Staff member
What is the value returned by the following query:
Code:
SELECT like_users, likes FROM xengallery_media WHERE media_id = ?
Where '?' should be a media ID belonging to any media item that causes this error.
 

thumped

Well-known member
What is the value returned by the following query:
Code:
SELECT like_users, likes FROM xengallery_media WHERE media_id = ?
Where '?' should be a media ID belonging to any media item that causes this error.
like_users likes
NULL 5
 

Chris D

XenForo developer
Staff member
Do you have any explanation as to why the like count is 5 but there are no like users? Have you been trying to do something specific like reset the likes for all media item or similar? Sort of wondering whether you emptied the xf_liked_content table for a specific reason, separate to trying to fix this issue?
 

thumped

Well-known member
Do you have any explanation as to why the like count is 5 but there are no like users? Have you been trying to do something specific like reset the likes for all media item or similar? Sort of wondering whether you emptied the xf_liked_content table for a specific reason, separate to trying to fix this issue?
deleting all entries for the xengallery_media content type from the xf_liked_content table hasn't helped...
just an attempt to make the problem go away
 

Chris D

XenForo developer
Staff member
It's still not really clear why the like_users is empty, though or whether this has happened as part of something you intended to do for a specific reason?

For example, if a media item has been liked 5 times, I would have expected this error to have happened sooner -- it's presumably preventing the media items from being accessed at all. So something must have triggered the like_users to be emptied in these cases. Any idea what might have happened here?
 

thumped

Well-known member
It's still not really clear why the like_users is empty, though or whether this has happened as part of something you intended to do for a specific reason?

For example, if a media item has been liked 5 times, I would have expected this error to have happened sooner -- it's presumably preventing the media items from being accessed at all. So something must have triggered the like_users to be emptied in these cases. Any idea what might have happened here?
i've no idea when the problem started -only noticed it on a google webmaster tools crawler report.

if there's a way to just delete all likes and disable likes functionality i'd be happy to try that...

edit: actually now that i check, the Like button is gone from media with zero likes...
 

Chris D

XenForo developer
Staff member
Well seeing as you have already deleted the original likes data for all media then the solution right now is to delete the cached data too.
Code:
UPDATE xengallery_media
SET likes = 0, like_users = NULL
 

thumped

Well-known member
Well seeing as you have already deleted the original likes data for all media then the solution right now is to delete the cached data too.
Code:
UPDATE xengallery_media
SET likes = 0, like_users = NULL
BINGO
 

thumped

Well-known member
so the question now is: what did i do? how did i remove the 'like' option from XFMG? and when? that's three questions, isn't it? no, four.
 
Top