This commit calls array_values on a string. array_values($values['target_id']) instead of array_values($values).

Currently this renders adding a product from the interface broken.

CommentFileSizeAuthor
#2 array_values-2764119-1.patch550 bytespontus_nilsson

Comments

pontus_nilsson created an issue. See original summary.

pontus_nilsson’s picture

StatusFileSize
new550 bytes

Adding patch.

pontus_nilsson’s picture

Status: Active » Needs review
agoradesign’s picture

Status: Needs review » Needs work

bojanz committed this a few days ago: http://cgit.drupalcode.org/commerce/commit/?id=3fb6ec8

Your problem is obivously resulting from that change -> looks like, that $values['target_id'] can be a string as well as an array, so both cases must be considered. Why this can be different, is another question. I'm sure bojanz knows more about that

bojanz’s picture

We need to expand our tests to cover both single and multiple selections, config and content entities.
We currently test only for multiple content entities. The fix was to make config entities work as well.

bojanz’s picture

Priority: Normal » Critical

Our product page is broken.

Waiting for the fix to pass Travis: https://travis-ci.org/drupalcommerce/commerce/jobs/144440669

Looked into the tests, they already cover single and multiple cardinality fields. It's a mystery why they aren't failing here.

  • bojanz committed 3d46cf4 on 8.x-2.x
    Issue #2764119 by bojanz, pontus_nilsson: massageFormValues calls...
bojanz’s picture

Status: Needs work » Fixed

Pushed the reworked fix.

Status: Fixed » Closed (fixed)

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