Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x]: Key "site" for array with keys "0, 1" does not exist on saving Commerce sites settings #3426

Closed
vnali opened this issue Mar 12, 2024 · 5 comments
Labels
bug commerce5 Craft Commerce ℹ️ status: need more info When waiting for user to supply database or more information.

Comments

@vnali
Copy link

vnali commented Mar 12, 2024

What happened?

Description

When saving commerce sites settings on admin/commerce/settings/sites page, if there is two sites and we select same store for both sites, on saving the form, we get 'Key "site" for array with keys "0, 1" does not exist' on line of 20 of src/templates/settings/stores/_siteStore.twig.

Craft CMS version

5.0.0-beta.6

Craft Commerce version

5.0.0-beta.1

PHP version

8.2

Operating system and version

No response

Database type and version

MariaDB 10.6.7

Image driver and version

No response

Installed plugins and versions

@vnali vnali added commerce4 Issues related to Commerce v4 Craft Commerce bug labels Mar 12, 2024
@lukeholder
Copy link
Member

Hi @vnali I can't reproduce the issue. Can you make sure you don't have any pending project config changes and try saving it again?

@lukeholder lukeholder added commerce5 ℹ️ status: need more info When waiting for user to supply database or more information. and removed commerce4 Issues related to Commerce v4 labels Mar 13, 2024
@vnali
Copy link
Author

vnali commented Mar 13, 2024

Hi @lukeholder
I tried to 'Reapply Everything' and after commenting some lines in the SpokeAndChain module, I got an error related to line of 350 of emails services complaining about senderAddress key is not available.
This was a migrated SpokeAndChain demo from Craft 4 to Craft 5. maybe I should wait for an official SpokeAndChain demo.
Thanks!

@vnali
Copy link
Author

vnali commented Mar 14, 2024

Hello @lukeholder
I just tried this on another Craft 5.0.0-beta.7 without any plugins or modules

  • Installed Commerce 5.0.0-beta.1
  • Added a new site
  • Create a new store without any additional settings.
  • Applied project config to make sure everything is in sync. -it returned All done!-
  • Selected same store for both sites. on saving the form, I got 'Key "site" for array with keys "0, 1" error
  • I tried to delete the new store and i get another error
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`craft5`.`commerce_shippingcategories`, CONSTRAINT `fk_jrwgtxfdxqfbdsxhdmnnbbmvwiogvvynezkz` FOREIGN KEY (`storeId`) REFERENCES `commerce_stores` (`id`))The SQL being executed was: DELETE FROM `commerce_stores` WHERE `id`=2'

@nfourtythree
Copy link
Contributor

Hi @vnali

Thank you for bringing this to our attention.

We have pushed a fix that will be included in the next release of Commerce 5 beta.

To get this early, change your craftcms/commerce requirement in your project's composer.json to:

"require": {
  "craftcms/commerce": "5.0.x-dev#93f7931e14c7052d662352f95606c1e18ea4fc61 as 5.0.0-beta.1",
  "...": "..."
}

Then run composer update.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug commerce5 Craft Commerce ℹ️ status: need more info When waiting for user to supply database or more information.
Projects
None yet
Development

No branches or pull requests

3 participants