Hi there. This module is EXACTLY what we need for our site, thanks for developing it.

After installing it, we are getting the following error (we are using php 5.3.3):

warning: Invalid argument supplied for foreach() in /var/www/landscapemafia.com/sites/all/modules/uc_attribute_stock_filter/uc_attribute_stock_filter.module on line 97.

These are code lines 96 through 102:

      // Traverse through $form and unset any options that are not on the list
      foreach ($form['attributes'] as $key => $attribute) {
        if (is_numeric($key)) {
          foreach ($form['attributes'][$key]['#options'] as $opt_key => $option) {
            // Make sure it's numeric, don't kill the "Select..." option
            if (is_numeric($opt_key) && !in_array($opt_key, $available)) {
              unset($form['attributes'][$key]['#options'][$opt_key]);

The module is still finding out of stock attributes, and keeping them from displaying...so thats good. Its just that the error messages are killing me.

Cheers

Comments

dirtysteak’s picture

Anyone else seen this? Thoughts?

I'd love to mess with php and submit a patch but I need some ideas, I'm all out...

dirtysteak’s picture

bump....this is really becoming a hassle. My log is virtually unusable.

czeky’s picture

same here..

max36’s picture

I found the patch below which fixed this issue for me:

http://drupal.org/files/issues/uc_attribute_stock_filter.module_2.patch

max36’s picture

I found the patch below which fixed this issue for me:

http://drupal.org/files/issues/uc_attribute_stock_filter.module_2.patch

mcdoolz’s picture

Has this been committed? I'm using the latest dev version and seeing this error.