tikiatua / internal-assets-plugin

A simple plugin for Craft CMS to allow for private assets
MIT License
33 stars 8 forks source link

Craft 4 Version Doesn't Specify Proper Schema Version #27

Closed timnolte closed 4 months ago

timnolte commented 1 year ago

After upgrading to the latest version of the plugin for our Craft v4 upgrade we are now receiving the following error when attempting to apply Project configurations.

Your project config files were created for different versions of Craft and/or plugins than what’s currently installed.

Internal Assets is installed with schema version of 1.0.0 while 2.0.0 was expected.

Try running `composer install` from your terminal to resolve.

I believe you need to add

"schemaVersion": "2.0.0",

Into the extra section of your composer.json.

timnolte commented 1 year ago

Actually, this may not be enough, looks like you'll most likely also need to include it in the main plugin Class property setup. https://github.com/tikiatua/internal-assets-plugin/blob/craft4/src/Plugin.php

    /**
     * @inheritdoc
     */
    public string $schemaVersion = '2.0.0';
timnolte commented 1 year ago

FYI, I patched the plugin via Composer and did confirm that adding the public string $schemaVersion = '2.0.0'; to the Plugin.php file did in fact fix the issue.

tikiatua commented 4 months ago

Hi @timnolte

I am currently checking if the plugin works with Craft version 5 and also wanted to look into this issue. Do you know if there any documentation available for the $schemaVersion feature? I could not find anything.

timnolte commented 4 months ago

@tikiatua it's been a bit but I think you'd have to look at the plugin development documentation. This may also be a case of looking at the Craft classes that are being extended to see what they specify. We won't be upgrading the site I am managing to Craft v4 as the site is in the planning stages of a rebuild and we won't be using Craft for the rebuild.

tikiatua commented 4 months ago

Closing this, as this seems to be a special case.

chrisrowe commented 3 months ago

I hit this too, I dropped my schemaVersion to 1.0.0 in the project.yaml file to bypass this.