i am seeing a lot of these in my log ... any idea what causes it?

Notice: Undefined offset: 0 in Drupal\commerce_cattributes\Plugin\Field\FieldWidget\CorrectProductVariationAttributesWidget->selectVariationFromUserInput() (line 311 of /srv/bindings/d219d1dd3a5540bf83ce053a9db6083f/code/web/modules/contrib/commerce_xattributes/modules/commerce_cattributes/src/Plugin/Field/FieldWidget/CorrectProductVariationAttributesWidget.php) #0 /srv/bindings/d219d1dd3a5540bf83ce053a9db6083f/code/web/core/includes/bootstrap.inc(582): _drupal_error_handler_real(8, 'Undefined offse...', '/srv/bindings/d...', 311, Array) #1 /srv/bindings/d219d1dd3a5540bf83ce053a9db6083f/code/web/modules/contrib/commerce_xattributes/modules/commerce_cattributes/src/Plugin/Field/FieldWidget/CorrectProductVariationAttributesWidget.php(311): _drupal_error_handler(8, 'Undefined offse...', '/srv/bindings/d...', 311, Array) #2 /srv/bindings/d219d1dd3a5540bf83ce053a9db6083f/code/web/modules/contrib/commerce_xattributes/modules/commerce_cattributes/src/Plugin/Field/FieldWidget/CorrectProductVariat

Comments

drupalstrap created an issue. See original summary.

pyxio’s picture

and this as well

Warning: count(): Parameter must be an array or an object that implements Countable in Drupal\commerce_cattributes\Plugin\Field\FieldWidget\CorrectProductVariationAttributesWidget->formElement() (line 227 of /srv/bindings/d219d1dd3a5540bf83ce053a9db6083f/code/web/modules/contrib/commerce_xattributes/modules/commerce_cattributes/src/Plugin/Field/FieldWidget/CorrectProductVariationAttributesWidget.php) #0 /srv/bindings/d219d1dd3a5540bf83ce053a9db6083f/code/web/core/includes/bootstrap.inc(582): _drupal_error_handler_real(2, 'count(): Parame...', '/srv/bindings/d...', 227, Array) #1 [internal function]: _drupal_error_handler(2, 'count(): Parame...', '/srv/bindings/d...', 227, Array) #2 /srv/bindings/d219d1dd3a5540bf83ce053a9db6083f/code/web/modules/contrib/commerce_xattributes/modules/commerce_cattributes/src/Plugin/Field/FieldWidget/CorrectProductVariationAttributesWidget.php(227): count('black') #3 /srv/bindings/d219d1dd3a5540bf83ce053a9db6083f/code/web/core/lib/Drupal/Core/Field/WidgetBase.php(335): Drupal\commerce_cattributes\Plugin\Field\FieldWidget\CorrectProductVariationAttributesWidget-

pyxio’s picture

the warning count happens when simply viewing the product page

pyxio’s picture

through further testing it seems to be happening when only one default attribute is available ... as in no other choices (only one product variation)

pyxio’s picture

another update ... it happens even if there are multiple attributes ... but if ONE of the attributes only has one default option.

  • drugan committed 6258c53 on 8.x-1.x
    Issue #2956665: undefined offset notices
    
drugan’s picture

Version: 8.x-1.0-beta4 » 8.x-1.x-dev

Sorry for late responding. I have a lot of paid work now and not having free time so much.

Please, try the latest dev version and if it will work for you then I'll make a new beta release.

pyxio’s picture

dev version seems to have resolved the issue.

drugan’s picture

Status: Fixed » Closed (fixed)

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