verbb / formie

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

[5.x] Getting Fatal PHP Error #1864

Closed hheckel closed 1 month ago

hheckel commented 1 month ago

Describe the bug

When I am deploying my local environment (where everything works) to my Servd stage (PHP 8.3), I get the following fatal error: `PHP Fatal Error – yii\base\ErrorException During class fetch: Uncaught Error: Interface "verbb\formie\base\SubFieldInterface" not found in /var/www/html/vendor/verbb/formie/src/base/SubField.php:22 Stack trace:

0 /var/www/html/vendor/composer/ClassLoader.php(576): include()

1 /var/www/html/vendor/composer/ClassLoader.php(427): Composer\Autoload{closure}('/var/www/html/v...')

2 /var/www/html/vendor/verbb/formie/src/fields/Address.php(35): Composer\Autoload\ClassLoader->loadClass('verbb\formie\ba...')

3 /var/www/html/vendor/composer/ClassLoader.php(576): include('/var/www/html/v...')

4 /var/www/html/vendor/composer/ClassLoader.php(427): Composer\Autoload{closure}('/var/www/html/v...')

5 [internal function]: Composer\Autoload\ClassLoader->loadClass('verbb\formie\fi...')

6 /var/www/html/vendor/verbb/formie/src/base/PluginTrait.php(239): class_alias('verbb\formie\fi...', 'verbb\formie\fi...')

7 /var/www/html/vendor/composer/ClassLoader.php(576): include('/var/www/html/v...')

8 /var/www/html/vendor/composer/ClassLoader.php(427): Composer\Autoload{closure}('/var/www/html/v...')

9 /var/www/html/vendor/verbb/formie/src/Formie.php(87): Composer\Autoload\ClassLoader->loadClass('verbb\formie\ba...')

10 /var/www/html/vendor/composer/ClassLoader.php(576): include('/var/www/html/v...')

11 /var/www/html/vendor/composer/ClassLoader.php(427): Composer\Autoload{closure}('/var/www/html/v...')

12 [internal function]: Composer\Autoload\ClassLoader->loadClass('verbb\formie\Fo...')

13 /var/www/html/vendor/craftcms/cms/src/services/Plugins.php(913): is_subclass_of('verbb\formie\Fo...', 'craft\base\Plug...')

14 /var/www/html/vendor/craftcms/cms/src/services/Plugins.php(233): craft\services\Plugins->createPlugin('formie', Array)

15 /var/www/html/vendor/craftcms/cms/src/base/ApplicationTrait.php(1640): craft\services\Plugins->loadPlugins()

16 /var/www/html/vendor/craftcms/cms/src/web/Application.php(110): craft\web\Application->_postInit()

17 /var/www/html/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\web\Application->init()

18 /var/www/html/vendor/yiisoft/yii2/base/Application.php(204): yii\base\BaseObject->__construct(Array)

19 [internal function]: yii\base\Application->__construct(Array)

20 /var/www/html/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs(Array)

21 /var/www/html/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('craft\web\Appli...', Array, Array)

22 /var/www/html/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\web\Appli...', Array, Array)

23 /var/www/html/vendor/craftcms/cms/src/Craft.php(70): yii\BaseYii::createObject(Array, Array)

24 /var/www/html/vendor/craftcms/cms/bootstrap/bootstrap.php(316): Craft::createObject(Array)

25 /var/www/html/vendor/craftcms/cms/bootstrap/web.php(40): require('/var/www/html/v...')

26 /var/www/html/web/index.php(11): require('/var/www/html/v...')

27 {main}`

I searched here and found a former bug that prevented formie from getting installed – the suggested "solution" to use something like composer require verbb/formie:"dev-craft-5 as 3.0.0-beta.9" worked temporarily, but it keeps crashing after some time again with the same error...

Steps to reproduce

  1. Install lateste Formie on local Dev
  2. Deploy to Servd stage
  3. Try to open the site - error

Form settings

Craft CMS version

5.1.1

Plugin version

3.0.0-beta.9

Multi-site?

yes

Additional context

No response

engram-design commented 1 month ago

Like I mentioned in https://github.com/verbb/formie/issues/1753#issuecomment-1977704028 this is probably due to a Git case insensitivity with the class from verbb\formie\base\SubfieldInterface to verbb\formie\base\SubFieldInterface.

That should've been long fixed, and it seems strange that it crops up again "after some time"?

Might I suggest doing composer remove formie, then deploy, then composer require "verbb/formie:^3.0.0-beta.9" -w && php craft plugin/install formie

engram-design commented 1 month ago

Updated in 3.0.0-beta.10