Problem/Motivation

You get an error when using the store contextual filter argerument using the default value "Store filter".

Error: Object of class Drupal\commerce_store\Entity\Store could not be converted to string in implode() (line 83 of core/modules/views/src/Plugin/views/argument/NumericArgument.php).

Steps to reproduce

  1. Add a view of type "Commerce Product"
  2. Add a contextual filter of "Product: Stores" and choose "Provide default value" and choose this module's argument, "Store filter"
  3. Load the view to get the error

Proposed resolution

Return the store ID, not the entity.

Remaining tasks

Update store filter default argument class to return the store ID.

I shall post a MR in a moment. Thanks for the excellent module by the way! :)

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

littlepixiez created an issue. See original summary.

littlepixiez’s picture

Status: Active » Needs review

Changed it to return the store ID. :)

littlepixiez’s picture

Version: 1.0.0 » 1.0.x-dev
arunkumark’s picture

Status: Needs review » Reviewed & tested by the community

Patch will resolve the issue of Views argument.

arunkumark’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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