10000 Install.php Exception in tests and blank databases · Issue #158 · verbb/postie · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Install.php Exception in tests and blank databases #158

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

Open
joshuapease opened this issue May 5, 2025 · 2 comments
Open

Install.php Exception in tests and blank databases #158

joshuapease opened this issue May 5, 2025 · 2 comments

Comments

@joshuapease
Copy link
Contributor

Describe the bug

I've come across an edge case in Install.php that keeps my automated tests from running.

I have a Craft site with Commerce and Postie installed & set up in the project config.

When running codeception, the setup process runs in the folowing order (more or less)

  1. Start with an empty test database
  2. Install Craft, Commerce and Plugins
  3. Apply project config

However, Postie's install script expects for a Store to already be set up. That doesn't occur until the project config is applied.

This bug can also be reproduced when running craft install on an existing project with an empty database.

Here is the exception I'm getting:

 An error occurred while executing the "verbb\postie\migrations\Install migration: craft\commerce\services\Stores::getCurrentStore(): Return value must be of type craft\commerce\models\Store, null returned

Image

It seems like this call to $orderStatusService->saveOrderStatus($status, []); is throwing the exception.

I put together a PR with a quick fix for the issue... but there might be a better solution.

Steps to reproduce

  1. Install Commerce and Postie on a Craft project.
  2. Drop the database.
  3. Run craft install to recreate the database from the project config.

Postie's Install.php file should throw an excepton.

Craft CMS version

Craft: 5.7.1.1 Commerce: 5.3.11

Plugin version

5.0.10

Multi-site?

"Yes"

Additional context

No response

@engram-design
Copy link
Member

Yeah, good call on this. To get this early, run composer require verbb/postie:"dev-craft-5 as 5.0.10".

@joshuapease
Copy link
Contributor Author

Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0