I consistently get this error when saving a reservation:

Strict warning: Only variables should be passed by reference in merci_staff_load_user() (line 38 of \sites\all\modules\merci\modules\merci_staff\merci_staff.module).

It doesn't seem to effect the processing, but just give the annoying PHP strict warning. My PHP version is 5.2.17.

array_shift() expects a variable (not just a value), so adding one in a new line 38 solves the problem, like this:

$users = user_load_multiple(array(), array('name' => $post['name']));
if ($post and empty($post['override']) and ($newuser = array_shift($users))) {
$user = $newuser;
}

Martin

CommentFileSizeAuthor
#5 merci_staff.inc-error.jpg75.7 KBCheviot

Comments

pimok3000’s picture

I don´t know how to solve it but the same error for page title module uses this patch.

Maybe someone with a bit more knowledge of php can make a patch for the merci module out of this?

darrick’s picture

Status: Active » Needs review

I've posted a fix here: http://drupalcode.org/project/merci.git/commit/9314c6d

Please test.

darrick’s picture

Issue summary: View changes
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

Cheviot’s picture

Status: Closed (fixed) » Active
Issue tags: +Strict Errors not solved
StatusFileSize
new75.7 KB

I wish to open this again.

Using the latest patch as mentioned in http://drupalcode.org/project/merci.git/commit/9314c6d is still happens when creating a new reservation or updating this.

The error disappears when I click on "Limit List to Available Items" suggesting it is an array issue (unexpected results in an array?).

Strict warning: Only variables should be passed by reference in merci_staff_load_user() (line 38 of /Library/WebServer/Documents/podcocoon/sites/all/modules/merci/modules/merci_staff/merci_staff.module).

darrick’s picture

Version: 7.x-2.0-rc1 » 7.x-2.0
Status: Active » Postponed (maintainer needs more info)

I'm not able to reproduce this. Can you verify the patch was applied correctly? Can you test with the latest code?

When does the error occur? After saving the reservation? When selecting the user the reservation is for?

Thanks

Cheviot’s picture

The error occurred when opening a new reservation and when I tried to amend an existing reservation.
It disappears as seen in the image samples. I took me a good few extra hours trying to uninstall/re-installl and solved this.

I discovered that some left over in the db can cause a fresh install to fail so I had to resort to cleaning the db from all MERCI records manually. The strange thing was that I could create a new reservation and amend an existing one while MERCI no any views existed. It have me a hint there is a SQL record issue.

To create a really totally clean install II uninstalled MERCI, deleted manually all SQL MERCI related table/fields records. I copy a fresh MERCI module to drupal modules (to be sure there are no typing errors as I was trying to amend it). Then I re-installed MERCI. MERCI and views are now properly installed. I created a new reservation and the error appeared again expected because it is a fresh install, I applied the patch and.... it now works!

I conclude that in some cases it may help to start from scratch after first properly cleaning SQL db from any MERCI left overs, it worked in my case.

Thanks!

darrick’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Thanks for the update.