Jump to content



Photo
- - - - -

ACCESS VIOLATION between 'option level reviews' in 'Service' and CONTRAINT FK

oscom3 fkrelationship

  • Please log in to reply
2 replies to this topic

#1   foxp2

foxp2

    strong as a Twig

  • Banned
  • 310 posts
  • Real Name:Laurent
  • Gender:Male
  • Location:France

Posted 17 February 2012 - 20:20

Hi Harald,
hello solingen ? we have a problem

ALTER TABLE osc_reviews add CONSTRAINT idx_reviews_customers_id FOREIGN KEY (customers_id) REFERENCES osc_customers (customers_id) ON DELETE CASCADE ON UPDATE CASCADE;


but with enableReviews() method in \osCommerce\OM\Core\Site\Shop\Reviews class, if the constant SERVICE_REVIEW_ENABLE_REVIEWS = 0

we have :

PHP Warning: PDOStatement::execute(): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`oscom3`.`osc_reviews`, CONSTRAINT `idx_reviews_customers_id` FOREIGN KEY (`customers_id`) REFERENCES `osc_customers` (`customers_id`) ON DELETE CASCADE ON UPDATE CASCADE) in C:\UwAmp\www\oscom3\oscommerce\osCommerce\OM\Core\PDOStatement.php on line 65


and for Application code :

PHP Notice: insert into osc_reviews (products_id, customers_id, customers_name, reviews_rating, languages_id, reviews_text, reviews_status, date_added) values (:products_id, :customers_id, :customers_name, :reviews_rating, :languages_id, :reviews_text, :reviews_status, now()) in C:\UwAmp\www\oscom3\oscommerce\osCommerce\OM\Core\PDOStatement.php on line 68


because this parameter is null in this query ( static method : saveEntry() ):

$Qreview->bindInt(':customers_id', $data['customer_id']);


maybe I found a solution ...

Regards.
-------------------

#2   foxp2

foxp2

    strong as a Twig

  • Banned
  • 310 posts
  • Real Name:Laurent
  • Gender:Male
  • Location:France

Posted 17 February 2012 - 21:35

a mistake :
the real test :
SERVICE_REVIEW_ENABLE_MODERATION = -1 && SERVICE_REVIEW_ENABLE_REVIEWS = 2
recursive condition : true / true
-------------------

#3   Harald Ponce de Leon

Harald Ponce de Leon

    Healthy Giraffe

  • Core Team
  • 4,841 posts
  • Real Name:Harald Ponce de Leon
  • Gender:Male
  • Location:Solingen, Germany

Posted 17 February 2012 - 23:22

Hi Laurent..

Good catch. Will look into it.

Kind regards,
Harald Ponce de Leon





Also tagged with one or more of these keywords: oscom3, fkrelationship