After upgrading a site from Drupal 5.x to 6.x and upgrading from Views 1 to Views 2, I started getting the following error:
Error: warning: Division by zero in ...relatedcontent.module on line 1436.
when adding showing a specific view in the related content tab for a given node (for example: /node/8227/relatedcontent/13). The view also displayed as empty.
Here's what line 1435-1437 look like:
function _relatedcontent_items_per_page($result, $items_per_page) {
return ceil(count($result) / $items_per_page);
}
The first thing I tried was going into the "RelatedContent configuration" for the corresponding content type. Under "settings" I changed the "Length of node table:" setting from "All nodes" to 20.
This fixed the problem and the view now displays the appropriate nodes. However, I imagine there should be a way to fix the line at 1436 so the "All nodes" setting for the "Length of node table:" field doesn't generate an error.
Comment | File | Size | Author |
---|---|---|---|
#1 | relatedcontent-821878.patch | 1.29 KB | Raphael Apard |
Comments
Comment #1
Raphael Apard CreditAttribution: Raphael Apard commentedHere a patch to fix this issue and allows to display all nodes on the same page.
Comment #2
Naiya CreditAttribution: Naiya commentedthank You for Your patch, it is working ad hoc - if any problem appear i let You know.