Creating a new revision of a product node results in this error message every time I visit that page again:

Notice: Undefined property: stdClass::$sell_price in uc_price_per_role_node_load() (line 305 of /var/www/html/drupal_dev/sites/all/modules/uc_price_per_role/uc_price_per_role.module).

I may have applied a coupple patches. The offending line is:

$original_price = $node->sell_price;

CommentFileSizeAuthor
#2 1831360-uc_price_per_role.patch797 bytesDan Z
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dan Z’s picture

Some code above the offending line was somehow causing the problem. It was indexing on $row->nid when it should have been indexing on $row->vid. I fixed that, and it somehow solved the problem:

  if (!empty($node_array)) {

    $result = db_query("SELECT vid, nid, rid, price FROM {uc_price_per_role_prices} WHERE vid IN (:vids)", array(':vids' => array_keys($node_array)));

    foreach ($result as $key => $row) {
      $node_array[$row->vid]->role_prices[$row->rid] = $row->price;
    }

There needs to be a patch for this. I can submit one eventually, but I don't remember the command to do it....

Dan Z’s picture

Status: Active » Reviewed & tested by the community
FileSize
797 bytes

Ok, here's a patch with a fix. It assumes the patches in #1420394: Role Price Not Showing Up In Cart or Checkout have already been applied.

Dan Z’s picture

Status: Reviewed & tested by the community » Needs review
Dan Z’s picture

Status: Needs review » Closed (duplicate)