Go to admin/store/orders/create

Type in a user name to search for.

Click Search.

Get an AJAX crash.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DanZ’s picture

Fix attached. I guess my version of PHP insists on an lvalue in a reset().

Status: Active » Needs work

The last submitted patch, uc_order_create_form-1858690-1.patch, failed testing.

DanZ’s picture

Status: Needs work » Needs review
FileSize
790 bytes

Hmm. I guess the automated tests really want a default value. Let's try this.

longwave’s picture

Test failures in #1 are unrelated, looks like testbot ran out of disk space. But the default value ensures that the first radio button is preselected, which is a better user experience.

DanZ’s picture

FYI, searching by first name, last name, or e-mail address does not trigger this crash for me. I'm running PHP 5.3.18.

longwave’s picture

Status: Needs review » Fixed

We don't need the reset(), just key() will do. Committed, thanks for spotting this.

DanZ’s picture

The reset is a safety mechanism in case future code does something with the $options array before that line. It guarantees that key() will point to the first element of the array.

It's not required for current code, though, yes.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.