New 4.7.3 drupal install with yesterday's 4.7.0 ecommerce running on php 5.1.2. When creating a parcel I'm getting a number of array errors which are repeated when the parcel is displayed:

* warning: array_merge() [function.array-merge]: Argument #1 is not an array in htdocs\modules\ecommerce\parcel\parcel.module on line 79.
* warning: array_unique() [function.array-unique]: The argument should be an array in htdocs\modules\ecommerce\parcel\parcel.module on line 79.
... (I think repeated for each item in parcel)
* warning: in_array() [function.in-array]: Wrong datatype for second argument in htdocs\modules\ecommerce\product\product.module on line 190.

The parcel is also shown as sold out - this is the latest version without the mispelling error seen in http://drupal.org/node/70360.

CommentFileSizeAuthor
#2 parcel.module_0.patch264 bytesallie micka

Comments

adub’s picture

I've put the following on line 79 of parcel.module. Please be aware that I have no idea how this module works and it's a hack just to get rid of the error.

After:

/* With this approach, we can't have parcels within parcels! */
if ($product->ptype != 'parcel') {

I added:

if(!is_array($attributes)) { $attributes = (array)$attributes; }

allie micka’s picture

Priority: Normal » Critical
StatusFileSize
new264 bytes

I fixed this similarly, by initializing the $attributes variable on line 79.

So, this:

/* With this approach, we can't have parcels within parcels! */
if ($product->ptype != 'parcel') {

Becomes:

/* With this approach, we can't have parcels within parcels! */
$attribues = array();
if ($product->ptype != 'parcel') {

Bumping this to critical because you can't create/use parcels without a slew of error messages

allie micka’s picture

For those of you playing along at home, note my misspelling on "$attributes" in the above example. Instead use:

        /* With this approach, we can't have parcels within parcels! */
        $attributes = array();
        if ($product->ptype != 'parcel') {
brmassa’s picture

Status: Active » Fixed

fixed no v3

Anonymous’s picture

Status: Fixed » Closed (fixed)