Coder Social home page Coder Social logo

timmyomahony / craft-matrix-field-preview Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 4.0 4.42 MB

Configure a screenshot preview for all your matrix field blocks, giving your clients a better publishing experience.

Home Page: https://plugins.craftcms.com/matrix-field-preview

License: Other

PHP 77.36% Twig 22.64%
craft craft-plugin craft3 craftcms craftcms-plugin matrix-fields

craft-matrix-field-preview's Introduction

Hi there πŸ‘‹

My name is Timmy and I'm an independent Irish software developer helping tech-constrained teams pitch & deliver more ambitious apps and experiences.

On the tech side, I'm a full-stack developer with 10+ years of experience delivering fully-formed web apps, from dynamic and interactive frontend projects to data-centric backends and APIs.

Check out my homepage:

or find me around the web:

Want to chat?

craft-matrix-field-preview's People

Contributors

daltonrooney avatar timmyomahony avatar ttempleton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

craft-matrix-field-preview's Issues

Update to 4.0.1

Cannot update because of error:
Type of weareferal\matrixfieldpreview\MatrixFieldPreview::$schemaVersion must not be defined (as in class craft\base\Plugin)

Simplify configuration across environments

The plugin uses the settings page to configure fields. This is by design as the preview fields are really a "once-off" configuration step, not something that should be done regularly (or be visible to end users). For the plugin to work we use a custom database table as well as the Craft assets to save images.

Usually, on staging/production you would hide the settings page from users. But this means it will be difficult to configure the plugin from staging/production. You can either

  1. Enable settings temporarily on production and configure the plugin there
  2. Configure the plugin locally then do a database dump/restore as well as copying over assets from one instance to another

We've got another plugin craft-remote-sync to help with approach 2

We could potentially create an import/export approach, but this would be a big feature. For the moment, approach 1 or 2 will have to suffice

Preview images not displaying in Matrix field within Neo

Hi there, I have a Matrix field used within a Neo field but the matrix field previews don't seem to be displaying. Any way to add this in an upcoming update?
I would ideally just use neo but this is an existing project and I'm reusing a matrix builder.

Migration error

Trying to update the plugin and i am getting this error:

Database Exception: SQLSTATE[HY000]: General error: 1553 Cannot drop index 'af_matrixfieldpreview_blocktypes_config_siteId_fk': needed in a foreign key constraint
The SQL being executed was: ALTER TABLE af_matrixfieldpreview_blocktypes_config DROP COLUMN siteId

Migration: weareferal\matrixfieldpreview\migrations\m201031_132510_remove_unused_site_id

Craftcms: 3.5.15.1
Plugin: 1.2.1
Mysql: 5.7.32
PHP: 7.3

Error when assigned asset is deleted

If you have a matrix preview block with an image asset assigned, and then you delete that asset via the assets screen, you get an error from any entries page that has that an instance of that block assigned to it.

TypeError Argument 1 passed to craft\services\Assets::getThumbUrl() must be an instance of craft\elements\Asset, null given, called in /xxx/public_html/vendor/weareferal/matrix-field-preview/src/records/PreviewRecord.php on line 64

Neo Field cannot disable Previews

Hi,
I want to close preview for some neo field, but get some problem, "Undefined array key "enableTakeover".
Did I miss something need to do first ?

Thanks.

image
image
image

Console error : Uncaught TypeError: Cannot read properties of undefined (reading 'length')

We have a project with your plugin and https://plugins.craftcms.com/neo and there is an error in the browser console, when we are on a page with Neo field.

It append when the script BlockTypeModal.js try to create a new instance :

Uncaught TypeError: Cannot read properties of undefined (reading 'length')
BlockTypeModal.js line 285

mfp-js-bug
mfp-js-bug2

The thing is that the init method of BlockTypeModal is called twice, once with an Object with the categories attribute and second time with this object :

{
    "iconTypeBlock": {
        "name": "Icon Type Block",
        "handle": "iconTypeBlock",
        "description": "",
        "descriptionHTML": "",
        "categoryId": 3,
        "image": null,
        "thumb": null
    }
}

This block is a Neo block that can't be put at the top level of the content.

This bug does not seem to break anything, but it's a bit annoying πŸ™‚ and it brinks another problem with the Neo integration.

With Neo, we can create block that are not at "Top level" : that are child to another blocks. In our opinion, theses blocks should not be displayed in the in the Matrix Field Preview modal.

For now, we put all block that we want to be hidden into a category that we hide with a js script. Maybe a new feature with a way to exclude some blocks in the preview could be awesome!

Fix universal loading of script

Screenshot 2020-04-01 at 18 18 20

The way our asset is currently set up is to be injected on every page that gets rendered in the control panel everywhere!. For some reason though our bundle isn't being included while a call is still being made

Craft 4: Argument #2 ($folderId) must be of type int

Hi there!

Couldn't wait to try the new Craft 4 supported plugin. :)

When trying to upload a preview image I get the following error message:

There was a problem uploading your photo: craft\services\Assets::getNameReplacementInFolder(): Argument #2 ($folderId) must be of type int, craft\models\VolumeFolder given, called in /Users/xxx/Sites/xxx/vendor/weareferal/matrix-field-preview/src/services/PreviewImageService.php on line 68

At first I thought it had to do with the fact that I was using an S3 based FS, but after switching to a local FS the problem persisted.

Greetings,

Daaf

Uncaught ReferenceError: handle is not defined

Screenshot 2020-07-02 at 12 36 40

Uncaught ReferenceError: handle is not defined
    createBlockTypePreview PreviewField.js:336
    success PreviewField.js:115
    trigger garnish.js:830
    addBlock MatrixInput.js:279
    createNavigation PreviewField.js:238
    addListener garnish.js:893
    jQuery 9
    addListener garnish.js:891
    createNavigation PreviewField.js:232
    jQuery 2
    createNavigation PreviewField.js:187
    success PreviewField.js:143
    jQuery 7
    setupMatrixField PreviewField.js:55
    init PreviewField.js:41
    jQuery 2
    init PreviewField.js:31
    constructor garnish.js:768
    constructor garnish.js:40
    constructor garnish.js:40
    <anonymous> 6808:803
    jQuery 13
PreviewField.js:336:11

[FR] Support Neo field as well

We use the Neo field to build our sections and this plugin would be perfect for a lot of our sites.

Would support for Neo be hard? Happy to help out if you point me in the right direction ✌️

Takeover option not available for Neo fields

Description

Under "Configure Fields" for Neo fields, the "Takeover" display option is not available. This is available for Matrix fields.
Screen Shot 2022-06-22 at 4 01 55 PM

Additional Information

Craft CMS: v4.0.5.1
Neo: v3.1.1
Matrix Field Preview: v4.0.2

Database Exception when attempting to load the Matrix Block Types settings page

Hi

I just added a new block type to a matrix field. This caused the matrix field's 'Add block' button to fallback to the Craft default (presumably because I haven't added a preview image for the new field yet? Although I'm sure that didn't used to happen).

So I went to the plugin settings to upload a preview image, but I'm getting a General error: 1364 Field 'siteId' doesn't have a default value error when loading the Matrix Block Types settings page.

Craft version: 3.6.5.1
Matrix Field Preview version: 1.2.3

Here's the stacktrace:

PDOException: SQLSTATE[HY000]: General error: 1364 Field 'siteId' doesn't have a default value in /Users/pete/www/saracen/vendor/yiisoft/yii2/db/Command.php:1299
Stack trace:
#0 /Users/pete/www/saracen/vendor/yiisoft/yii2/db/Command.php(1299): PDOStatement->execute()
#1 /Users/pete/www/saracen/vendor/yiisoft/yii2/db/Command.php(1099): yii\db\Command->internalExecute('INSERT INTO `ma...')
#2 /Users/pete/www/saracen/vendor/yiisoft/yii2/db/Schema.php(433): yii\db\Command->execute()
#3 /Users/pete/www/saracen/vendor/yiisoft/yii2/db/ActiveRecord.php(600): yii\db\Schema->insert('{{%matrixfieldp...', Array)
#4 /Users/pete/www/saracen/vendor/yiisoft/yii2/db/ActiveRecord.php(566): yii\db\ActiveRecord->insertInternal(NULL)
#5 /Users/pete/www/saracen/vendor/yiisoft/yii2/db/BaseActiveRecord.php(678): yii\db\ActiveRecord->insert(true, NULL)
#6 /Users/pete/www/saracen/vendor/weareferal/matrix-field-preview/src/services/BaseBlockTypeConfigService.php(95): yii\db\BaseActiveRecord->save()
#7 /Users/pete/www/saracen/vendor/weareferal/matrix-field-preview/src/controllers/SettingsController.php(152): weareferal\matrixfieldpreview\services\BaseBlockTypeConfigService->getOrCreateByFieldHandle('productAddition...')
#8 /Users/pete/www/saracen/vendor/weareferal/matrix-field-preview/src/controllers/SettingsController.php(118): weareferal\matrixfieldpreview\controllers\SettingsController->_actionBlockTypes(Object(weareferal\matrixfieldpreview\services\MatrixBlockTypeConfigService), Object(weareferal\matrixfieldpreview\services\MatrixFieldConfigService), 'matrix-field-pr...')
#9 [internal function]: weareferal\matrixfieldpreview\controllers\SettingsController->actionMatrixBlockTypes()
#10 /Users/pete/www/saracen/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#11 /Users/pete/www/saracen/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#12 /Users/pete/www/saracen/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction('matrix-block-ty...', Array)
#13 /Users/pete/www/saracen/vendor/yiisoft/yii2/base/Module.php(534): craft\web\Controller->runAction('matrix-block-ty...', Array)
#14 /Users/pete/www/saracen/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction('matrix-field-pr...', Array)
#15 /Users/pete/www/saracen/vendor/yiisoft/yii2/web/Application.php(104): craft\web\Application->runAction('matrix-field-pr...', Array)
#16 /Users/pete/www/saracen/vendor/craftcms/cms/src/web/Application.php(259): yii\web\Application->handleRequest(Object(craft\web\Request))
#17 /Users/pete/www/saracen/vendor/yiisoft/yii2/base/Application.php(392): craft\web\Application->handleRequest(Object(craft\web\Request))
#18 /Users/pete/www/saracen/web/index.php(22): yii\base\Application->run()
#19 /Users/pete/.composer/vendor/laravel/valet/server.php(214): require('/Users/pete/www...')
#20 {main}

Next yii\db\Exception: SQLSTATE[HY000]: General error: 1364 Field 'siteId' doesn't have a default value
The SQL being executed was: INSERT INTO `matrixfieldpreview_blocktypes_config` (`description`, `fieldId`, `blockTypeId`, `dateCreated`, `dateUpdated`, `uid`) VALUES ('', 216, 20, '2021-02-15 11:56:48', '2021-02-15 11:56:48', '94c2019e-6a83-4667-bec7-1d2c48bed9aa') in /Users/pete/www/saracen/vendor/yiisoft/yii2/db/Schema.php:678
Stack trace:
#0 /Users/pete/www/saracen/vendor/yiisoft/yii2/db/Command.php(1304): yii\db\Schema->convertException(Object(PDOException), 'INSERT INTO `ma...')
#1 /Users/pete/www/saracen/vendor/yiisoft/yii2/db/Command.php(1099): yii\db\Command->internalExecute('INSERT INTO `ma...')
#2 /Users/pete/www/saracen/vendor/yiisoft/yii2/db/Schema.php(433): yii\db\Command->execute()
#3 /Users/pete/www/saracen/vendor/yiisoft/yii2/db/ActiveRecord.php(600): yii\db\Schema->insert('{{%matrixfieldp...', Array)
#4 /Users/pete/www/saracen/vendor/yiisoft/yii2/db/ActiveRecord.php(566): yii\db\ActiveRecord->insertInternal(NULL)
#5 /Users/pete/www/saracen/vendor/yiisoft/yii2/db/BaseActiveRecord.php(678): yii\db\ActiveRecord->insert(true, NULL)
#6 /Users/pete/www/saracen/vendor/weareferal/matrix-field-preview/src/services/BaseBlockTypeConfigService.php(95): yii\db\BaseActiveRecord->save()
#7 /Users/pete/www/saracen/vendor/weareferal/matrix-field-preview/src/controllers/SettingsController.php(152): weareferal\matrixfieldpreview\services\BaseBlockTypeConfigService->getOrCreateByFieldHandle('productAddition...')
#8 /Users/pete/www/saracen/vendor/weareferal/matrix-field-preview/src/controllers/SettingsController.php(118): weareferal\matrixfieldpreview\controllers\SettingsController->_actionBlockTypes(Object(weareferal\matrixfieldpreview\services\MatrixBlockTypeConfigService), Object(weareferal\matrixfieldpreview\services\MatrixFieldConfigService), 'matrix-field-pr...')
#9 [internal function]: weareferal\matrixfieldpreview\controllers\SettingsController->actionMatrixBlockTypes()
#10 /Users/pete/www/saracen/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#11 /Users/pete/www/saracen/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#12 /Users/pete/www/saracen/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction('matrix-block-ty...', Array)
#13 /Users/pete/www/saracen/vendor/yiisoft/yii2/base/Module.php(534): craft\web\Controller->runAction('matrix-block-ty...', Array)
#14 /Users/pete/www/saracen/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction('matrix-field-pr...', Array)
#15 /Users/pete/www/saracen/vendor/yiisoft/yii2/web/Application.php(104): craft\web\Application->runAction('matrix-field-pr...', Array)
#16 /Users/pete/www/saracen/vendor/craftcms/cms/src/web/Application.php(259): yii\web\Application->handleRequest(Object(craft\web\Request))
#17 /Users/pete/www/saracen/vendor/yiisoft/yii2/base/Application.php(392): craft\web\Application->handleRequest(Object(craft\web\Request))
#18 /Users/pete/www/saracen/web/index.php(22): yii\base\Application->run()
#19 /Users/pete/.composer/vendor/laravel/valet/server.php(214): require('/Users/pete/www...')
#20 {main}
Additional Information:
Array
(
    [0] => HY000
    [1] => 1364
    [2] => Field 'siteId' doesn't have a default value
)

Bad Github merging

I stupidly merged a feature directly into master, then tried to revert that merge commit. This worked, but it meant that when I eventually correctly merged the feature to dev and then dev into master, master didn't actually have the feature as the revert commit was still in the master's history (but not in devs). This meant I had to revert the revert in master πŸ€•

Screenshot 2020-10-28 at 17 29 23

Handle asset soft deletions

See issue #36 for more details on what the problem is. I've pushed a quickfix that will stop the errors but doesn't address the underlying issue.

Foreign key deletions aren't working on MySQL

Our migrations for deleting FKs look like:

$this->dropColumn(
  "{{%matrixfieldpreview_blocktypes_config}}",
  "categoryId");

Which works OK on Postgres, but seems to cause an issue with MySQL. It seems like both the index and constraint have to be deleted separately. When I tried this though I got further errors.

Better integration/tolerance with the existing Craft MatrixInput JavaScript

For the plugin to work we need to be able to make use of the MatrixInput JavaScript for each matrix field rendered on the page.

Craft stores reference to this class on the <div class="matrix-field ..."> element's DOM/$.data() so we can get access via:

var matrixInput = $matrixField.data("matrix");

The problem is there is no guarantee that Craft has finished loading the MatrixInput for any particular class. For example, if you do this immediately on the page load, matrixInput is undefined. JQuery doesn't have any build in listener for this, nor does Craft seem to have any registration pattern that you can use to listen for when the input has stopped rendering. Therefore the best you can do is either delay, or do some sort of back-off check.

Fix Composer 2 compatibility

When installing this plugin with Composer 1, the following deprecation notice is output:

Deprecation Notice: Class weareferal\matrixfieldpreview\assets\PreviewField\PreviewFieldAsset located in ./vendor/weareferal/matrix-field-preview/src/assets/previewfield/PreviewFieldAsset.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0.

Composer 2 was released on October 24, and is now the default version that will be installed, so it’s critical that this gets resolved ASAP, or people will start getting Class not found errors.

To fix, run the following command:

> git mv src/assets/previewfield src/assets/PreviewField

Then commit your change and tag a new release.

(Note that you must use the git mv command, as Git tends to not notice case-sensitive file renames otherwise.)

Matrix field not appearing when in a Supertable

Hi,

I am using your plugin, but I've noticed when I have a Matrix block within a Supertable field within a Matrix block. The field doesn't show anything.

With Matrix Preview enabled (Accordion content missing):
image

With Matrix Preview disabled (Accordion content shows):
image

With it enabled, I do get the following error in console:

[Error] undefined (anonymous function) (BaseFieldPreview.js:40) (anonymous function) u (jquery.js:25:24456) fireWith (jquery.js:25:25200) S (jquery.js:25:76157) (anonymous function) (jquery.js:25:78615)

Thanks

Wrong preview images displayed for block types with same name

If you have two block types from two different matrix fields that both have the same handle name (for example cta) then it looks like they will both use only 1 of the preview images. In other words, block types are not being distinguised by their matrix field, only by their handle name

Craft 4.0 support

Leaving this here in case 4.0 compatibility is on the roadmap. We're currently testing on a forked repo and will report back if we have any issues.

Error while updating to v3

Getting this error while updating to v3. Still on craft cms 3.7.44

Database Exception: SQLSTATE[HY000]: General error: 4161 Unknown data type: 'DROP'
The SQL being executed was: ALTER TABLE craft_matrixfieldpreview_blocktypes_config CHANGE categoryId categoryId DROP NOT NULL

Migration: weareferal\matrixfieldpreview\migrations\m220602_095344_add_category_foreignkey

Output:

> add column categoryId integer to table {{%matrixfieldpreview_blocktypes_config}} ... done (time: 0.237s)
> alter column categoryId in table {{%matrixfieldpreview_blocktypes_config}} to DROP NOT NULL ...Exception: SQLSTATE[HY000]: General error: 4161 Unknown data type: 'DROP'
The SQL being executed was: ALTER TABLE craft_matrixfieldpreview_blocktypes_config CHANGE categoryId categoryId DROP NOT NULL (/Users/user/Sites/website/vendor/yiisoft/yii2/db/Schema.php:676)
#0 /Users/user/Sites/website/vendor/yiisoft/yii2/db/Command.php(1320): yii\db\Schema->convertException(Object(PDOException), 'ALTER TABLE cr...')
#1 /Users/user/Sites/website/vendor/yiisoft/yii2/db/Command.php(1105): yii\db\Command->internalExecute('ALTER TABLE cr...')
#2 /Users/user/Sites/website/vendor/yiisoft/yii2/db/Migration.php(420): yii\db\Command->execute()
#3 /Users/user/Sites/website/vendor/weareferal/matrix-field-preview/src/migrations/m220602_095344_add_category_foreignkey.php(16): yii\db\Migration->alterColumn('{{%matrixfieldp...', 'categoryId', 'DROP NOT NULL')
#4 /Users/user/Sites/website/vendor/craftcms/cms/src/db/Migration.php(53): weareferal\matrixfieldpreview\migrations\m220602_095344_add_category_foreignkey->safeUp()
#5 /Users/user/Sites/website/vendor/craftcms/cms/src/db/MigrationManager.php(232): craft\db\Migration->up(true)
#6 /Users/user/Sites/website/vendor/craftcms/cms/src/db/MigrationManager.php(148): craft\db\MigrationManager->migrateUp(Object(weareferal\matrixfieldpreview\migrations\m220602_095344_add_category_foreignkey))
#7 /Users/user/Sites/website/vendor/craftcms/cms/src/services/Updates.php(250): craft\db\MigrationManager->up()
#8 /Users/user/Sites/website/vendor/craftcms/cms/src/controllers/BaseUpdaterController.php(532): craft\services\Updates->runMigrations(Array)
#9 /Users/user/Sites/website/vendor/craftcms/cms/src/controllers/UpdaterController.php(201): craft\controllers\BaseUpdaterController->runMigrations(Array, 'restore-db')
#10 [internal function]: craft\controllers\UpdaterController->actionMigrate()
#11 /Users/user/Sites/website/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /Users/user/Sites/website/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#13 /Users/user/Sites/website/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('migrate', Array)
#14 /Users/user/Sites/website/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module->runAction('updater/migrate', Array)
#15 /Users/user/Sites/website/vendor/craftcms/cms/src/web/Application.php(690): craft\web\Application->runAction('updater/migrate')
#16 /Users/user/Sites/website/vendor/craftcms/cms/src/web/Application.php(250): craft\web\Application->_processUpdateLogic(Object(craft\web\Request))
#17 /Users/user/Sites/website/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#18 /Users/user/Sites/website/public/index.php(12): yii\base\Application->run()
#19 /Users/user/.composer/vendor/laravel/valet/server.php(234): require('/Users/user/S...')
#20 {main}

Make previews in entries optional?

At the moment we do a complete takeover of the default blocks button. It might be a better idea to augment the default dropdown with an alternative button instead. This could be an option.

'Changes to the project config are not possible while in read-only mode.'

I got this error when installing 1.1.3 up from 1.0.7 on production when running migrations craft migrate/all:

Exception 'craft\errors\MigrateException' with message 'An error occurred while migrating Matrix Field Preview.'

in /home/forge/weareferal.com/vendor/craftcms/cms/src/services/Updates.php:235

Caused by: Exception 'yii\base\NotSupportedException' with message 'Changes to the project config are not possible while in read-only mode.'

in /home/forge/weareferal.com/vendor/craftcms/cms/src/services/ProjectConfig.php:458

Stack trace:
#0 /home/forge/weareferal.com/vendor/craftcms/cms/src/services/Updates.php(151): craft\services\ProjectConfig->set()
#1 /home/forge/weareferal.com/vendor/craftcms/cms/src/services/Updates.php(228): craft\services\Updates->setNewPluginInfo()
#2 /home/forge/weareferal.com/vendor/craftcms/cms/src/console/controllers/MigrateController.php(328): craft\services\Updates->runMigrations()
#3 [internal function]: craft\console\controllers\MigrateController->actionAll()
#4 /home/forge/weareferal.com/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#5 /home/forge/weareferal.com/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams()
#6 /home/forge/weareferal.com/vendor/yiisoft/yii2/console/Controller.php(179): yii\base\Controller->runAction()
#7 /home/forge/weareferal.com/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction()
#8 /home/forge/weareferal.com/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction()
#9 /home/forge/weareferal.com/vendor/craftcms/cms/src/console/Application.php(101): yii\console\Application->runAction()
#10 /home/forge/weareferal.com/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction()
#11 /home/forge/weareferal.com/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest()
#12 /home/forge/weareferal.com/craft(22): yii\base\Application->run()
#13 {main}
Script @php craft migrate/all handling the craft-update event returned with error code 1
Script @craft-update was called via post-install-cmd

Why I think this is happening:

There is a schema change to the plugin as part of this 1.1 update (1.0 to 1.1). This is so that Craft understands that the plugin has migrations to run. This schema change involves the project config being updated (config/project/plugins/plugins.yaml). This should happen locally when you update the plugin and those changes should be checked into git and deployed with the update so that the production server runs the database migrations but already has the updated project config.

In my case when I updated the plugin locally, for some reason the project config changes weren't created or I didn't check them in (need to test this again). I deployed to my development environment (where admin changes are allowed) and didn't notice that the project config changes were happening there. When I went to deploy to production, because admin changes aren't allowed, I get this error.

The fix in my case was to manually update the schema for this plugin in config/project/plugins/plugins.yaml to use the new schema:

matrix-field-preview:
  edition: standard
  enabled: true
  licenseKey: 
  schemaVersion: 1.1.0

I need to test why these project config changes to schema weren't added to my local version when updating

Disable the "Add" button when limit is reached.

Default craft behavior on a matrix is to disable the "Add" button if you set a max number of rows for a matrix. This plugin doesn't appear to check for that and allows a user to attempt to add a new row even if they've hit the limit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.