Download & Extend

Strict warning: Only variables should be passed by reference in uc_order_create_form() (line 523 of uc_order.admin.inc)

Project:Ubercart
Version:7.x-3.x-dev
Component:Orders
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Go to admin/store/orders/create

Type in a user name to search for.

Click Search.

Get an AJAX crash.

Comments

#1

Status:active» needs review

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

AttachmentSizeStatusTest resultOperations
uc_order_create_form-1858690-1.patch571 bytesIdleFAILED: [[SimpleTest]]: [MySQL] 2,175 pass(es), 25 fail(s), and 3 exception(s).View details

#2

Status:needs review» needs work

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

#3

Status:needs work» needs review

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

AttachmentSizeStatusTest resultOperations
attribute_option_form_validate-1854692-3.patch790 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 2,767 pass(es).View details

#4

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.

#5

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.

#6

Status:needs review» fixed

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

#7

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.

#8

Status:fixed» closed (fixed)

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