You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like restoring an order status that was previously soft-deleted in the database doesn't work correctly. I created an order status, opened a PR, then went back to another branch and ran project-config/apply, which soft-deletes the order status in the database by setting the dateDeleted in the commerce_orderstatuses table. After going back to the branch with that order status and running project-config/apply again, the order status was not restored. I checked the database, and the row still included the dataDeleted. Manually setting that value to NULL caused the order status to show up again.
Steps to reproduce
Create a new order status.
git stash --include-untracked all changes in the config/ folder and apply the project config. This marks the order status as soft deleted in the database.
git stash pop to get back the config. Apply the project config again.
The order status should be visible again, but it isn't, because it's still soft-deleted in the database.
Expected behavior
Applying the project config should properly restore soft-deleted order statuses.
Craft CMS version
4.4.7.1
Craft Commerce version
4.2.7
PHP version
8.2
Operating system and version
No response
Database type and version
MySQL 8.0
Image driver and version
No response
Installed plugins and versions
No response
The text was updated successfully, but these errors were encountered:
@MoritzLost The order status project config does not yet listen to the restored order status. This is the reason why the database record was not updated. On the latest version, it only updates the database to on update and on remove order status.
@pdaleramirez I don't quite understand, but I disagree with classifying this as enhancement. The project config is the source of truth for the state of the site. If I have an order status in the project config, but it doesn't appear in the backend after running project-config/apply – well, that's just a bug. Also, how is everyone supposed to use this? Switching between different project config states, which results in project config elements being repeatedly created and deleted, is very common in a git-based feature branch workflow.
I don't know how difficult this would be to resolve. But it isn't a nice-to-have, it's a broken feature that requires a tedious workaround to fix, so this should get a higher priority than a potential enhancement.
What happened?
Description
Looks like restoring an order status that was previously soft-deleted in the database doesn't work correctly. I created an order status, opened a PR, then went back to another branch and ran
project-config/apply
, which soft-deletes the order status in the database by setting thedateDeleted
in thecommerce_orderstatuses
table. After going back to the branch with that order status and runningproject-config/apply
again, the order status was not restored. I checked the database, and the row still included thedataDeleted
. Manually setting that value toNULL
caused the order status to show up again.Steps to reproduce
git stash --include-untracked
all changes in theconfig/
folder and apply the project config. This marks the order status as soft deleted in the database.git stash pop
to get back the config. Apply the project config again.Expected behavior
Applying the project config should properly restore soft-deleted order statuses.
Craft CMS version
4.4.7.1
Craft Commerce version
4.2.7
PHP version
8.2
Operating system and version
No response
Database type and version
MySQL 8.0
Image driver and version
No response
Installed plugins and versions
No response
The text was updated successfully, but these errors were encountered: