verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
95 stars 72 forks source link

Error on trying to open stencils or create new form #2073

Open umkasanki opened 4 days ago

umkasanki commented 4 days ago

Describe the bug

I have such error on trying to open stencils or create a new form after upgrade to Craft 5.

yii\base\UnknownPropertyException: Setting unknown property: verbb\formie\fields\Hidden::vid in /app/vendor/yiisoft/yii2/base/Component.php:217
Stack trace:
#0 /app/vendor/craftcms/cms/src/helpers/App.php(1479): yii\base\Component->__set('vid', 'new7215-7087')
#1 /app/vendor/craftcms/cms/src/base/Model.php(84): craft\helpers\App::configure(Object(verbb\formie\fields\Hidden), Array)
#2 /app/vendor/verbb/formie/src/base/Field.php(264): craft\base\Model->__construct(Array)
#3 /app/vendor/verbb/formie/src/fields/Hidden.php(62): verbb\formie\base\Field->__construct(Array)
#4 [internal function]: verbb\formie\fields\Hidden->__construct(Array)
#5 /app/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs(Array)
#6 /app/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('verbb\\formie\\fi...', Array, Array)
#7 /app/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('verbb\\formie\\fi...', Array, Array)
#8 /app/vendor/craftcms/cms/src/Craft.php(70): yii\BaseYii::createObject(Array, Array)
#9 /app/vendor/craftcms/cms/src/helpers/Component.php(142): Craft::createObject(Array)
#10 /app/vendor/verbb/formie/src/services/Fields.php(433): craft\helpers\Component::createComponent(Array, 'verbb\\formie\\ba...')
#11 /app/vendor/verbb/formie/src/models/FieldLayoutRow.php(95): verbb\formie\services\Fields->createField(Array)
#12 /app/vendor/yiisoft/yii2/base/Component.php(180): verbb\formie\models\FieldLayoutRow->setFields(Array)
#13 /app/vendor/craftcms/cms/src/helpers/App.php(1479): yii\base\Component->__set('fields', Array)
#14 /app/vendor/craftcms/cms/src/base/Model.php(84): craft\helpers\App::configure(Object(verbb\formie\models\FieldLayoutRow), Array)
#15 /app/vendor/verbb/formie/src/models/FieldLayoutPage.php(127): craft\base\Model->__construct(Array)
#16 /app/vendor/yiisoft/yii2/base/Component.php(180): verbb\formie\models\FieldLayoutPage->setRows(Array)
#17 /app/vendor/craftcms/cms/src/helpers/App.php(1479): yii\base\Component->__set('rows', Array)
#18 /app/vendor/craftcms/cms/src/base/Model.php(84): craft\helpers\App::configure(Object(verbb\formie\models\FieldLayoutPage), Array)
#19 /app/vendor/verbb/formie/src/models/FieldLayoutPage.php(53): craft\base\Model->__construct(Array)
#20 /app/vendor/verbb/formie/src/models/StencilData.php(145): verbb\formie\models\FieldLayoutPage->__construct(Array)
#21 /app/vendor/verbb/formie/src/models/Stencil.php(65): verbb\formie\models\StencilData->__construct(Array)
#22 /app/vendor/verbb/formie/src/services/Stencils.php(62): verbb\formie\models\Stencil->__construct(Array)
#23 /app/vendor/verbb/formie/src/controllers/StencilsController.php(33): verbb\formie\services\Stencils->getAllStencils()
#24 [internal function]: verbb\formie\controllers\StencilsController->actionIndex()
#25 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#26 /app/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#27 /app/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('index', Array)
#28 /app/vendor/craftcms/cms/src/web/Application.php(350): yii\base\Module->runAction('formie/stencils...', Array)
#29 /app/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('formie/stencils...', Array)
#30 /app/vendor/craftcms/cms/src/web/Application.php(318): yii\web\Application->handleRequest(Object(craft\web\Request))
#31 /app/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#32 /app/web/index.php(12): yii\base\Application->run()
#33 {main}

image image

Steps to reproduce

  1. Update Craft from 4 to 5
  2. Open Formie / Settings / Stencils

Form settings

Craft CMS version

Craft Pro 5.4.5.1

Plugin version

3.0.7

Multi-site?

No

Additional context

Configured Integration with HubSpot

engram-design commented 4 days ago

Sounds like this stencil wasn't properly upgraded from Formie 2. This wasn't something you've manually carried over from another (older) project, or you're using a base project that's out of date?

umkasanki commented 4 days ago

This is a new stencil I created for this project in Formie 2 a week before the update. Is there any way to run the stencil upgrade?

umkasanki commented 4 days ago

I tried to run Craft update 3 times. Stencils are not updated for some reason.. I also tried rerunning the m240318_000000_migrate_stencils migration. That didn't solve the problem. It looks like this migration isn't working..

engram-design commented 4 days ago

This migration should be updating your stencils, but I can just add some handling in the main stencil class to make things easier.

Before I do so, and to check if there's any other invalid properties, would you mind sending your stencil YAML through to support@verbb.io so I can take a look?

umkasanki commented 4 days ago

I've tried to run this migration. That didn't solve the problem.

would you mind sending your stencil YAML through to support@verbb.io so I can take a look?

Done.

engram-design commented 4 days ago

Thanks! Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.7".