craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.21k stars 616 forks source link

[5.x]: Installing Redactor plugin results in an exception #14077

Closed khalwat closed 6 months ago

khalwat commented 6 months ago

What happened?

Description

Installing the Redactor plugin on Craft CMS 5.0.0-alpha.3 results in:

Migration Error – craft\errors\MigrationException
An error occurred while executing the "craft\redactor\migrations\Install migration: require_once(/var/www/project/cms_v5/vendor/craftcms/redactor/src/migrations/m180430_204710_remove_old_plugins.php): Failed to open stream: No such file or directory

And indeed, the plugin's install.php migration:

    public function safeUp(): bool
    {
        // Auto-convert old Rich Text fields
        $this->update('{{%fields}}', [
            'type' => Field::class,
        ], [
            'type' => 'craft\\fields\\RichText',
        ], [], false);

        // Update any Redactor configs
        Plugin::getInstance()->getMigrator()->migrateUp('m180430_204710_remove_old_plugins');

        return true;
    }

...tries to run m180430_204710_remove_old_plugins.php which does not exist

here's the require section of the composer.json:

  "require": {
    "php": "^8.2.0",
    "craftcms/cms": "^5.0.0-alpha.1",
    "craftcms/ckeditor": "4.0.x-dev",
    "craftcms/redactor": "4.0.x-dev",
    "nystudio107/craft-twig-base-templates": "^1.0.0",
    "nystudio107/twig-bundle-installer": "^1.0.0",
    "vlucas/phpdotenv": "^5.4.0",
    "yiisoft/yii2-redis": "^2.0.6"
  },

Steps to reproduce

  1. Attempt to install the Redactor plugin on Craft CMS 5.0.0-alpha

Expected behavior

The plugin will install

Actual behavior

An exception is thrown

Craft CMS version

5.0.0-alpha.3

PHP version

8.2

Operating system and version

n/a

Database type and version

n/a

Image driver and version

n/a

Installed plugins and versions

-

brandonkelly commented 6 months ago

This was fixed via craftcms/redactor#476

brandonkelly commented 6 months ago

Looks like I merged the PR 13 minutes before you posted this!

khalwat commented 6 months ago

That seems unfair, Brandon. :)