When updating drupal to 9.13 i get this erreur

Recoverable fatal error : Object of class Drupal\commerce_store\Entity\Store could not be converted to string dans Drupal\webform\Utility\WebformOptionsHelper::hasOption() (/home/aubmmaroc/public_html/preprod/modules/contrib/webform/src/Utility/WebformOptionsHelper.php ligne 59)

when i try to add Commerce Webform Order Handler

thanks

CommentFileSizeAuthor
#6 3199079-06.patch804 bytesvisabhishek

Comments

sayoung created an issue. See original summary.

sayoung’s picture

Assigned: sayoung » Unassigned
jrockowitz’s picture

Project: Webform » Commerce Webform Order
Version: 6.0.0 » 2.0.0-beta1
sayoung’s picture

more details plz

visabhishek’s picture

We can replicate the issue by adding multiple store.

in CommerceWebformOrderHandler.php we are passing store object while for single store we are just returning id.

      if (count($stores) == 1) {
        $form['tabs_wrapper']['store']['store_entity']['#default_value'] = reset($stores);
      }
      // Otherwise load the default store.
      elseif (($default_store = $this->entityTypeManager->getStorage('commerce_store')->loadDefault()) !== NULL) {
        $form['tabs_wrapper']['store']['store_entity']['#default_value'] = $default_store;
      }
    }
visabhishek’s picture

Version: 2.0.0-beta1 » 2.x-dev
Status: Active » Needs review
StatusFileSize
new804 bytes

Providing patch for this issue.

mattbloomfield’s picture

The patch works great. Is there a chance it could get into a release?

pcambra’s picture

Status: Needs review » Reviewed & tested by the community

  • facine committed 528148e on 2.x authored by visabhishek
    Issue #3199079 by visabhishek, sayoung, mattbloomfield, pcambra:...
facine’s picture

Status: Reviewed & tested by the community » Fixed

Fixed, thank you!

Please download and review the latest dev release.

Status: Fixed » Closed (fixed)

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