Resolved Bug


This bug has been marked as resolved.

Fatal PHP Error in SelectAttributeTypeController::searchForm

Permalink 0 0 Browser Info Environment
I haven't debugged how it happened we had a product with a select attribute option that didn't exist. The SelectAttributeTypeController::searchForm method was failing with a fatal error because the option object was invalid.

The following code:
foreach($options as $id) {
  if ($id > 0) {
    $opt = SelectAttributeTypeOption::getByID($id);
    $optionText[] = $opt->getSelectAttributeOptionValue();
  }
}

should be changed to:
foreach($options as $id) {
  if ($id > 0) {
    $opt = SelectAttributeTypeOption::getByID($id);
    if (is_object($opt)) {
      $optionText[] = $opt->getSelectAttributeOptionValue();
    }
  }
}

Tags:

Status: Resolved

Still Valid:

This bug is valid a newer version of concrete5. View Current Bug
tbcrowe
View Replies:

concrete5 Environment Information

any

Browser User-Agent String

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13