Andreas2003 Posted June 29, 2009 Share Posted June 29, 2009 Hi there, I have found an error in the review system. When the not-logged-in customer clicks on "Write a review", he will get redirected to the login-page, which is correct and ok. But after logging into his account, he will not get the "product_reviews_write.php" displayed, but he will get redirected to the "review_notice.php", saying that his review (that he has not written yet) is being submitted. I have compared my installed files with some of the review contributions, but cannot find the error. In my product_info.php, the following code is <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where approved = 1 and products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; } else { echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params()) . '">' . tep_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a>'; } ?> where this is the Write-Button: echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params()) . '">' . tep_image_button('button_write_review.gif', After clicking on that button, he will be redirected to the login-page. In the login-page, there is no code which handles anything with reviews, which might be ok. But where is the page submitted, the login-page has to jump to, after log in ? Thanks in advance for any help, Regards Andreas Link to comment Share on other sites More sharing options...
masat Posted June 29, 2009 Share Posted June 29, 2009 The jumping action is usually handled by the snapshot in the session variable which is set forth in application_top.php. The basic release does not have a file review_notice.php so I have to assume you have added a contribution which has disrupted the flow. Try the forum for the contribution you installed. That would be the best bet for a quick resolution to your issue. How do you know when you know what you want to do for the rest of your life? Link to comment Share on other sites More sharing options...
Andreas2003 Posted July 1, 2009 Author Share Posted July 1, 2009 Hi Tim, yes, you're right. I have "review approval" installed and that might be the problem. The point is, that I cannot find any "big" differences, why redirection should not work anymore. Link to comment Share on other sites More sharing options...
Andreas2003 Posted August 3, 2009 Author Share Posted August 3, 2009 Still have the problem. I placed the following code into the header.php to see the $navigation: <?php echo print_r($navigation); ?> My osCsid for this test was "60a78a3fc380b22a524da082e32dab61". Then I saw the following output on the reviews.php, where I can read the existing reviews: navigationHistory Object ( [path] => Array ( [0] => Array ( => product_reviews_write.php [mode] => NONSSL [get] => Array ( [products_id] => 3616 [amp;osCsid] => cc7aa36b9171397a2b9c64062c721dba ) [post] => Array ( ) ) [1] => Array ( => login.php [mode] => NONSSL [get] => Array ( [osCsid] => 60a78a3fc380b22a524da082e32dab61 ) [post] => Array ( ) ) [2] => Array ( => product_info.php [mode] => NONSSL [get] => Array ( [products_id] => 3615 [osCsid] => 60a78a3fc380b22a524da082e32dab61 ) [post] => Array ( ) ) [3] => Array ( => product_reviews.php [mode] => NONSSL [get] => Array ( [products_id] => 3615 [osCsid] => 60a78a3fc380b22a524da082e32dab61 ) [post] => Array ( ) ) ) [snapshot] => Array ( => product_reviews_write.php [mode] => NONSSL [get] => Array ( [products_id] => 3616 [amp;osCsid] => cc7aa36b9171397a2b9c64062c721dba ) [post] => Array ( ) ) ) 1 Then I hit "Write review" and were redirected to the login.php with the following output: navigationHistory Object ( [path] => Array ( [0] => Array ( => product_reviews_write.php [mode] => NONSSL [get] => Array ( [products_id] => 3615 [osCsid] => 60a78a3fc380b22a524da082e32dab61 ) [post] => Array ( ) ) [1] => Array ( => login.php [mode] => NONSSL [get] => Array ( [osCsid] => 60a78a3fc380b22a524da082e32dab61 ) [post] => Array ( ) ) ) [snapshot] => Array ( => product_reviews_write.php [mode] => NONSSL [get] => Array ( [products_id] => 3615 [osCsid] => 60a78a3fc380b22a524da082e32dab61 ) [post] => Array ( ) ) ) 1 Then I entered a correct login. I got no "wrong password" or no other message. I was redirected to the login.php again and again with the following output: navigationHistory Object ( [path] => Array ( [0] => Array ( => product_reviews_write.php [mode] => NONSSL [get] => Array ( [products_id] => 3615 [amp;osCsid] => 60a78a3fc380b22a524da082e32dab61 ) [post] => Array ( ) ) [1] => Array ( => login.php [mode] => NONSSL [get] => Array ( [osCsid] => dde1b99ba24874f554e0e12688af5436 ) [post] => Array ( ) ) ) [snapshot] => Array ( => product_reviews_write.php [mode] => NONSSL [get] => Array ( [products_id] => 3615 [amp;osCsid] => 60a78a3fc380b22a524da082e32dab61 ) [post] => Array ( ) ) ) 1 What I wonder beside the error of being redirected to the login.php again: a ) why are two osCsids shown in the output ? cc7aa36b9171397a2b9c64062c721dba 60a78a3fc380b22a524da082e32dab61 <= that was my session id for this test b ) what means [amp;osCsid] instead of [osCsid] ? Thank you very much for every input on that issue. Regards Andreas Link to comment Share on other sites More sharing options...
spooks Posted August 3, 2009 Share Posted August 3, 2009 I seem to remember this from ages ago, adding to history or smthg. Anyway if you use http://addons.oscommerce.com/info/4397 it don`t have the issue Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
Andreas2003 Posted August 3, 2009 Author Share Posted August 3, 2009 Hi Sam, thanks for your answer, but I compared my files with the mentioned contribution as well and found no big differences. Any other ideas? Regards Andreas Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.