drastic Well-known member Jan 1, 2016 #1 Saw this a few times today. Any idea how to fix? Thanks Division by zero Today at 2:35 PM - library/XenGallery/ControllerPublic/Comment.php:48
Saw this a few times today. Any idea how to fix? Thanks Division by zero Today at 2:35 PM - library/XenGallery/ControllerPublic/Comment.php:48
Chris D XenForo developer Staff member Jan 2, 2016 #4 Could you post the full stack trace from the server error log?
drastic Well-known member Jan 2, 2016 #5 That's all that was in the server error log when I logged into my XF admin. Is there a different spot that has more info?
That's all that was in the server error log when I logged into my XF admin. Is there a different spot that has more info?
Chris D XenForo developer Staff member Jan 2, 2016 #6 You can click on the server error entry and it will load the full stack trace of the error.
drastic Well-known member Jan 3, 2016 #7 ErrorException: Division by zero - library/XenGallery/ControllerPublic/Comment.php:48 Generated By: Unknown Account, Yesterday at 2:45 PM Stack Trace #0 /mypathhere.com/library/XenGallery/ControllerPublic/Comment.php(48): XenForo_Application::handlePhpError(2, 'Division by zer...', '/mypath/...', 48, Array) #1 /mypathhere.com/library/XenForo/FrontController.php(351): XenGallery_ControllerPublic_Comment->actionIndex() #2 /mypathhere.com/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch)) #3 /mypathhere.com/index.php(13): XenForo_FrontController->run() #4 {main} Request State array(3) { ["url"] => string(47) "https://www.mydomain.com/media/comments/2/" ["_GET"] => array(0) { } ["_POST"] => array(0) { } }
ErrorException: Division by zero - library/XenGallery/ControllerPublic/Comment.php:48 Generated By: Unknown Account, Yesterday at 2:45 PM Stack Trace #0 /mypathhere.com/library/XenGallery/ControllerPublic/Comment.php(48): XenForo_Application::handlePhpError(2, 'Division by zer...', '/mypath/...', 48, Array) #1 /mypathhere.com/library/XenForo/FrontController.php(351): XenGallery_ControllerPublic_Comment->actionIndex() #2 /mypathhere.com/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch)) #3 /mypathhere.com/index.php(13): XenForo_FrontController->run() #4 {main} Request State array(3) { ["url"] => string(47) "https://www.mydomain.com/media/comments/2/" ["_GET"] => array(0) { } ["_POST"] => array(0) { } }
Daniel Hood Well-known member Jan 4, 2016 #8 PHP: $page = floor($commentsBefore / $commentsPerPage) + 1; is the line erroring. Do you have the option xengalleryMaxCommentsPerPage set to 0? It might be a good idea for PHP: $commentsPerPage = XenForo_Application::getOptions()->xengalleryMaxCommentsPerPage; to get changed to PHP: $commentsPerPage = max(1, XenForo_Application::getOptions()->xengalleryMaxCommentsPerPage);
PHP: $page = floor($commentsBefore / $commentsPerPage) + 1; is the line erroring. Do you have the option xengalleryMaxCommentsPerPage set to 0? It might be a good idea for PHP: $commentsPerPage = XenForo_Application::getOptions()->xengalleryMaxCommentsPerPage; to get changed to PHP: $commentsPerPage = max(1, XenForo_Application::getOptions()->xengalleryMaxCommentsPerPage);
drastic Well-known member Jan 5, 2016 #9 Is that something I'd find in a template somewhere? A template search came up empty in my XF admin.
Chris D XenForo developer Staff member Jan 5, 2016 #10 It's in the Options. Admin CP > Applications > Gallery Options > Page Layout Options > "Max number of comments (per page)"
It's in the Options. Admin CP > Applications > Gallery Options > Page Layout Options > "Max number of comments (per page)"
Chris D XenForo developer Staff member Jan 6, 2016 #12 We shouldn't be allowing 0 here so this is changed in the next release. Thanks.