1

I'm reviewing someone's code that loads, does something to it, and saves it.

$review = Mage::getModel('review/review')->load($id);
...
$review->setWebsiteId(0);
...
$review->save();

When a review object is loaded, there is no website ID, and the tables don't, either. I'm wondering if this is required or not. The reviews seem to get saves just fine without it. Any ideas?

2
  • From what I know, the website id is not required. but the simplest way to test is to remove the line and try again. See what happens.
    – Marius
    Feb 19, 2014 at 15:29
  • Yeah, it works without it. The only thing that seems to assign the review to a website is the store ID, which is already defined in $review when loaded.
    – laketuna
    Feb 19, 2014 at 15:30

1 Answer 1

0

This is a silly answer, but website_id is not a field for the review object (Mage_Review_Model_Review) and, therefore, not required.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.