The php function array_shift() is defined as follows:

mixed function array_shift(&$array);

Which means the parameter the function is designed to accept is a variable (accepted by reference), and should not be any direct value.

However, in this line, we are sending an array as a value rather than a variable to the function:

    $field = array_shift(array_keys($schema['fields']));

While this will still work, we should change the code to pass what PHP is designed to accept: a variable.

    $field_keys = array_keys($schema['fields']);
    $field = array_shift($field_keys);

I'll be including a patch to make this change. This should also silence any E_STRICT errors users are getting.

Comments

apotek’s picture

Status: Active » Needs review
StatusFileSize
new474 bytes

And here's the patch.

apotek’s picture

This passed the tests and has been sitting here for a couple months. Any chance we can get this in? Would like to keep our production code in line with uuid development.

We've had this code in production for almost 3 months now, and it's been working fine.

skwashd’s picture

Thanks for the patch and sorry for the delay in applying it. This has been committed (04a1185) and will be included in the next official release of the module.

skwashd’s picture

Status: Needs review » Fixed

Fixing status.

Status: Fixed » Closed (fixed)

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