Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Issue with Complete Reviews System Contribution


7 replies to this topic

#1 benelson

  • Community Member
  • 4 posts
  • Real Name:Ben Nelson

Posted 22 February 2009, 01:33

Hi all this is my first of many posts here I hope!

I just installed the contribution Complete Reviews System, the "Complete Reviews System with Star Rating System" package. It works great. I then attempted to install the extremely simple "Complete Reviews System (Admin) V1.5.txt" package.
The contribution can be found at: http://addons.oscommerce.com/info/4397

After installing the new admin addon I get the following error in the "Reviews" page in the admin area:

Warning: Division by zero in /home/lightzom/public_html/teststore/admin/includes/classes/split_page_results.php on line 33
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-0, MAX_SEARCH_RESULTS_ADMIN' at line 1

select reviews_id, products_id, last_modified, reviews_rating, approved, date_added from reviews order by date_added DESC limit -0, MAX_SEARCH_RESULTS_ADMIN

I tried to find what is causing the error in the admin/reviews.php file that is completely replaced and in the modified file admin/includes/functions/html_output.php . Neither of which look like they would produce this error. I'm sorry if this is an overly simple fix but I can't seem to figure it out and didn't see a topic already created for this contribution.

Thanks!

#2 jcall

  • Community Member
  • 3,092 posts
  • Real Name:Jared Call
  • Gender:Male
  • Location:Saratoga Springs, UT

Posted 22 February 2009, 01:43

Sounds like you're on an unpatched version of osCommerce. There is a fix for split_page_results.php, both the catalog and the admin version, specifically for this error.

In both files, change this:
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

to this:
$sql_query .= " limit " . max($offset, 0) . ", " . $max_rows_per_page;

You should strongly consider applying the current patches.

-jared

#3 benelson

  • Community Member
  • 4 posts
  • Real Name:Ben Nelson

Posted 22 February 2009, 02:10

Hey Jared thanks for the reply!
I just went into both files and they were both already updated with the line you said to change.
The admin page reads:
      $offset = ($max_rows_per_page * ($current_page_number - 1));
      $sql_query .= " limit " . max($offset, 0) . ", " . $max_rows_per_page;
The catalog one reads:
      $offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));

      $this->sql_query .= " limit " . max($offset, 0) . ", " . $this->number_of_rows_per_page;


#4 galey1981

  • Community Member
  • 99 posts
  • Real Name:David Gale

Posted 01 March 2009, 13:09

Hi Ben - did you fix the Issue with Complete Reviews System Contribution - i have EXACTLY the same problem :rolleyes:

#5 jwilkins

  • Community Member
  • 63 posts
  • Real Name:James Wilkins
  • Gender:Male
  • Location:Hull, UK

Posted 06 March 2009, 22:21

Hi All - have any of you located a way to fix the issue with the Complete Reviews System as stated above? I too have the same problem and have spent the past two hours searching the forums for an answer, but to no avail! Your help or guidance would be greatly apprciated!

James

#6 benelson

  • Community Member
  • 4 posts
  • Real Name:Ben Nelson

Posted 06 March 2009, 22:51

Hey James we still haven't figured out the answer to this problem. We are still just using the unupdated version.

#7 jwilkins

  • Community Member
  • 63 posts
  • Real Name:James Wilkins
  • Gender:Male
  • Location:Hull, UK

Posted 07 March 2009, 00:13

Hi Ben - Thanks for getting back to me so quickly! It looks like I'll have to do the same until I can find/work out a fix. I'll post anything I find!

Cheers
James

#8 seank123

  • Community Member
  • 337 posts
  • Real Name:Sean Kennedy
  • Gender:Male

Posted 18 May 2009, 12:23

Found elsewhere:

In your /admin/includes/configure.php add this:

define('MAX_SEARCH_RESULTS_ADMIN', '20');