Jump to content
Sign in to follow this  
benelson

Issue with Complete Reviews System Contribution

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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;

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Found elsewhere:

 

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

 

define('MAX_SEARCH_RESULTS_ADMIN', '20');

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×