Skip to content

[4.x]: Craft 4 Upgrade Error (Undefined constant: EVENT_REGISTER_CONDITION_RULE_TYPES) #17742

@rossthomson89

Description

@rossthomson89

What happened?

Description

Trying to upgrade Craft CMS 4 to its latest version but running into an error during the migration process which states:

Exception 'Error' with message 'Undefined constant craft\base\conditions\BaseCondition::EVENT_REGISTER_CONDITION_RULE_TYPES'

My best guess at the moment is that Craft post upgrade, is trying to use an event called: "EVENT_REGISTER_CONDITION_RULE_TYPES" which is only available in Craft 5 (and not Craft 4).

https://craftcms.com/docs/5.x/extend/updating-plugins.html#condition-builder

Steps to reproduce

  1. Run: php craft update all (in terminal)

4.16.8 --> 4.16.11

Interestingly an upgrade from 4.16.8 to 4.16.10 seems to have no issues whatsoever (but upgrading to 4.16.11 throws the error)

Actual behavior

At this point the entire site will become available (both front end and admin control panel) with the error:

Applying new migrations ... error: The command "'/Applications/MAMP/bin/php/php8.3.14/bin/php' '/Users/redacted/Documents/Projects/redacted/craft' 'migrate/all' '--no-backup' '--no-content'" failed.

Craft CMS version

4.16.11

PHP version

8.3.14

Operating system and version

Darwin 24.6.0

Database type and version

MySQL 8.0.40

Image driver and version

Imagick (ImageMagick 7.1.0-23)

Installed plugins and versions

Amazon S3 - 2.2.3
Button Box - 4.2.4
Control Panel CSS - 2.6.0
Cookie Consent - 1.4.0
Freeform - 5.11.7
Navigation - 2.1.3
Neo - 4.4.3
oEmbed - 3.1.5
Redactor - 3.1.0
Redactor Custom Styles - 4.0.3
SEO - 4.2.4
Super Table - 3.0.16
Vite - 4.0.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions