Closed wsydney76 closed 12 months ago
Ah, looks like this happens because the Condition Rule Type was only registered for CP requests.
Going to close (assuming this behavior is intentional...)
/Karla
Yeah, you’d probably want to adjust that to include it for console requests as well.
What happened?
Description
For our starter project https://github.com/wsydney76/craft4-ddev-starter, there is a custom condition rule https://github.com/wsydney76/craft4-ddev-starter/blob/main/modules/main/conditions/HasDraftsConditionRule.php, attached to a custom element index source, (showing all drafts, regular and provisional, created by the current author):
Seems to work fine, but we got reports that this condition disappears once in a while.
Looks like it is reproducable by running
craft project-config/rebuild
, resulting in this compare fromproject.yaml
:(The code was obviously created back then without in-depth knowledge/docs, so something may be wrong. Should not result in such an error anyway.)
/Karla
Steps to reproduce
craft project-config/rebuild
Expected behavior
Nothing changes
Actual behavior
The condition is gone.
Craft CMS version
4.5.3
PHP version
8.1.21
Operating system and version
Linux 5.15.90.1-microsoft-standard-WSL2
Database type and version
MariaDB 10.4.30
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions