Go to admin/store/orders/create

Type in a user name to search for.

Click Search.

Get an AJAX crash.

Files: 
CommentFileSizeAuthor
#1 uc_order_create_form-1858690-1.patch571 bytesDanZ
FAILED: [[SimpleTest]]: [MySQL] 2,175 pass(es), 25 fail(s), and 3 exception(s).
[ View ]
#3 attribute_option_form_validate-1854692-3.patch790 bytesDanZ
PASSED: [[SimpleTest]]: [MySQL] 2,767 pass(es).
[ View ]

Comments

StatusFileSize
new571 bytes
FAILED: [[SimpleTest]]: [MySQL] 2,175 pass(es), 25 fail(s), and 3 exception(s).
[ View ]

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.

Status:Needs work» Needs review
StatusFileSize
new790 bytes
PASSED: [[SimpleTest]]: [MySQL] 2,767 pass(es).
[ View ]

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

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.

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.

Status:Needs review» Fixed

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

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.