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

OrderStatus query fails with Project Config enabled #1082

Closed
abryrath opened this issue Oct 25, 2019 · 1 comment
Closed

OrderStatus query fails with Project Config enabled #1082

abryrath opened this issue Oct 25, 2019 · 1 comment

Comments

@abryrath
Copy link

Description

The src/helpers/ProjectConfigData.php class erroneously adds the 'isArchived' column in a where clause for OrderStatus.

        $statusRows = (new Query())
            ->select([
                'id',
                'uid',
                'name',
                'handle',
                'color',
                'sortOrder',
                'default',
            ])
            ->where(['isArchived' => false])
            ->indexBy('id')
            ->orderBy('sortOrder')
            ->from([Table::ORDERSTATUSES])
            ->all();

The isArchived column was removed in migration m191007_184911_orderStatus_from_archived_to_deleted:

public function safeUp()
    {
        $this->renameColumn('{{%commerce_orderstatuses}}', 'dateArchived', 'dateDeleted');
        $this->dropColumn('{{%commerce_orderstatuses}}', 'isArchived');
    }

Additionally, it seems that the dateDeleted column is being populated, even if the OrderStatus has not been deleted. Because the dateDeleted is populated erroneously, I don't see any way to determine which OrderStatus records are valid.

[yii\db\Exception] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'isArchived' in 'where clause'
The SQL being executed was: SELECT `id`, `uid`, `name`, `handle`, `color`, `sortOrder`, `default`
FROM `commerce_orderstatuses`
WHERE `isArchived`=FALSE
ORDER BY `sortOrder`

Steps to reproduce

  1. Enable Project Config
  2. Enable Craft Commerce 2.2.5

Additional info

  • Craft version: 3.3.1
  • PHP version: 7.3.10
  • Database driver & version: MariaDB 15.1 (macOS 10.15 Catalina)
  • Plugins & versions: Commerce 2.2.5
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