craftcms / cms

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

[4.x]: 'generatePendingTransformsViaQueue' => false gives error on opening entry. #11247

Closed martijnvanonz closed 2 years ago

martijnvanonz commented 2 years ago

What happened?

Description

generatePendingTransformsViaQueue results in error. (https://github.com/craftcms/cms/issues/7360#issuecomment-762410501)

app.php
   'assets' => [
              'generatePendingTransformsViaQueue' => false,
          ],

yii\base\UnknownPropertyException: Setting unknown property: craft\services\Assets::generatePendingTransformsViaQueue in /var/www/backend/vendor/yiisoft/yii2/base/Component.php:209
Stack trace:
#0 /var/www/backend/vendor/yiisoft/yii2/BaseYii.php(558): yii\base\Component->__set('generatePending...', false)
#1 /var/www/backend/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(craft\services\Assets), Array)
#2 [internal function]: yii\base\BaseObject->__construct(Array)
#3 /var/www/backend/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs(Array)
#4 /var/www/backend/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('craft\\services\\...', Array, Array)
#5 /var/www/backend/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\services\\...', Array, Array)
#6 /var/www/backend/vendor/yiisoft/yii2/di/ServiceLocator.php(137): yii\BaseYii::createObject(Array)
#7 /var/www/backend/vendor/yiisoft/yii2/base/Module.php(766): yii\di\ServiceLocator->get('assets', true)
#8 /var/www/backend/vendor/craftcms/cms/src/web/Application.php(346): yii\base\Module->get('assets', true)
#9 /var/www/backend/vendor/craftcms/cms/src/base/ApplicationTrait.php(882): craft\web\Application->get('assets')
#10 /var/www/backend/vendor/craftcms/cms/src/fields/Assets.php(946): craft\web\Application->getAssets()
#11 /var/www/backend/vendor/craftcms/cms/src/fields/Assets.php(641): craft\fields\Assets->_determineUploadFolderId(Object(craft\elements\Entry), false, false)
#12 /var/www/backend/vendor/craftcms/cms/src/fields/BaseRelationField.php(1053): craft\fields\Assets->getInputSources(Object(craft\elements\Entry))
#13 /var/www/backend/vendor/craftcms/cms/src/fields/Assets.php(705): craft\fields\BaseRelationField->inputTemplateVariables(Array, Object(craft\elements\Entry))
#14 /var/www/backend/vendor/craftcms/cms/src/fields/BaseRelationField.php(638): craft\fields\Assets->inputTemplateVariables(Object(craft\elements\db\AssetQuery), Object(craft\elements\Entry))
#15 /var/www/backend/vendor/craftcms/cms/src/fields/Assets.php(290): craft\fields\BaseRelationField->inputHtml(Object(craft\elements\db\AssetQuery), Object(craft\elements\Entry))
#16 /var/www/backend/vendor/craftcms/cms/src/base/Field.php(453): craft\fields\Assets->inputHtml(Object(craft\elements\db\AssetQuery), Object(craft\elements\Entry))
#17 /var/www/backend/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(257): craft\base\Field->getInputHtml(Object(craft\elements\db\AssetQuery), Object(craft\elements\Entry))
#18 /var/www/backend/vendor/craftcms/cms/src/fieldlayoutelements/BaseField.php(215): craft\fieldlayoutelements\CustomField->inputHtml(Object(craft\elements\Entry), false)
#19 /var/www/backend/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(210): craft\fieldlayoutelements\BaseField->formHtml(Object(craft\elements\Entry), false)
#20 /var/www/backend/vendor/craftcms/cms/src/web/View.php(1544): craft\fieldlayoutelements\CustomField->craft\fieldlayoutelements\{closure}()
#21 /var/www/backend/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(211): craft\web\View->namespaceInputs(Object(Closure), 'fields')
#22 /var/www/backend/vendor/craftcms/cms/src/models/FieldLayout.php(681): craft\fieldlayoutelements\CustomField->formHtml(Object(craft\elements\Entry), false)
#23 /var/www/backend/vendor/craftcms/cms/src/web/View.php(1539): craft\models\FieldLayout->craft\models\{closure}()
#24 /var/www/backend/vendor/craftcms/cms/src/models/FieldLayout.php(680): craft\web\View->namespaceInputs(Object(Closure), NULL)
#25 /var/www/backend/vendor/craftcms/cms/src/controllers/ElementsController.php(717): craft\models\FieldLayout->createForm(Object(craft\elements\Entry), false, Array)
#26 /var/www/backend/vendor/craftcms/cms/src/controllers/ElementsController.php(426): craft\controllers\ElementsController->_prepareEditor(Object(craft\elements\Entry), true, Object(craft\web\Response), 'main-form', Object(Closure), Object(Closure), Object(Closure))
#27 [internal function]: craft\controllers\ElementsController->craft\controllers\{closure}(Object(craft\web\Response), 'main-form')
#28 /var/www/backend/vendor/craftcms/cms/src/web/CpScreenResponseFormatter.php(108): call_user_func(Object(Closure), Object(craft\web\Response), 'main-form')
#29 /var/www/backend/vendor/craftcms/cms/src/web/CpScreenResponseFormatter.php(48): craft\web\CpScreenResponseFormatter->_formatTemplate(Object(craft\web\Response), Object(craft\web\CpScreenResponseBehavior))
#30 /var/www/backend/vendor/yiisoft/yii2/web/Response.php(1095): craft\web\CpScreenResponseFormatter->format(Object(craft\web\Response))
#31 /var/www/backend/vendor/craftcms/cms/src/web/Response.php(275): yii\web\Response->prepare()
#32 /var/www/backend/vendor/yiisoft/yii2/web/Response.php(339): craft\web\Response->prepare()
#33 /var/www/backend/vendor/yiisoft/yii2/web/ErrorHandler.php(136): yii\web\Response->send()
#34 /var/www/backend/vendor/craftcms/cms/src/web/ErrorHandler.php(185): yii\web\ErrorHandler->renderException(Object(yii\base\UnknownPropertyException))
#35 /var/www/backend/vendor/yiisoft/yii2/base/ErrorHandler.php(135): craft\web\ErrorHandler->renderException(Object(yii\base\UnknownPropertyException))
#36 /var/www/backend/vendor/craftcms/cms/src/web/ErrorHandler.php(64): yii\base\ErrorHandler->handleException(Object(yii\base\UnknownPropertyException))
#37 [internal function]: craft\web\ErrorHandler->handleException(Object(yii\base\UnknownPropertyException))
#38 {main}
Previous exception:
yii\base\UnknownPropertyException: Setting unknown property: craft\services\Assets::generatePendingTransformsViaQueue in /var/www/backend/vendor/yiisoft/yii2/base/Component.php:209
Stack trace:
#0 /var/www/backend/vendor/yiisoft/yii2/BaseYii.php(558): yii\base\Component->__set('generatePending...', false)
#1 /var/www/backend/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(craft\services\Assets), Array)
#2 [internal function]: yii\base\BaseObject->__construct(Array)
#3 /var/www/backend/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs(Array)
#4 /var/www/backend/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('craft\\services\\...', Array, Array)
#5 /var/www/backend/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\services\\...', Array, Array)
#6 /var/www/backend/vendor/yiisoft/yii2/di/ServiceLocator.php(137): yii\BaseYii::createObject(Array)
#7 /var/www/backend/vendor/yiisoft/yii2/base/Module.php(766): yii\di\ServiceLocator->get('assets', true)
#8 /var/www/backend/vendor/craftcms/cms/src/web/Application.php(346): yii\base\Module->get('assets', true)
#9 /var/www/backend/vendor/craftcms/cms/src/base/ApplicationTrait.php(882): craft\web\Application->get('assets')
#10 /var/www/backend/vendor/craftcms/cms/src/fields/Assets.php(946): craft\web\Application->getAssets()
#11 /var/www/backend/vendor/craftcms/cms/src/fields/Assets.php(641): craft\fields\Assets->_determineUploadFolderId(Object(craft\elements\Entry), false, false)
#12 /var/www/backend/vendor/craftcms/cms/src/fields/BaseRelationField.php(1053): craft\fields\Assets->getInputSources(Object(craft\elements\Entry))
#13 /var/www/backend/vendor/craftcms/cms/src/fields/Assets.php(705): craft\fields\BaseRelationField->inputTemplateVariables(Array, Object(craft\elements\Entry))
#14 /var/www/backend/vendor/craftcms/cms/src/fields/BaseRelationField.php(638): craft\fields\Assets->inputTemplateVariables(Object(craft\elements\db\AssetQuery), Object(craft\elements\Entry))
#15 /var/www/backend/vendor/craftcms/cms/src/fields/Assets.php(290): craft\fields\BaseRelationField->inputHtml(Object(craft\elements\db\AssetQuery), Object(craft\elements\Entry))
#16 /var/www/backend/vendor/craftcms/cms/src/base/Field.php(453): craft\fields\Assets->inputHtml(Object(craft\elements\db\AssetQuery), Object(craft\elements\Entry))
#17 /var/www/backend/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(257): craft\base\Field->getInputHtml(Object(craft\elements\db\AssetQuery), Object(craft\elements\Entry))
#18 /var/www/backend/vendor/craftcms/cms/src/fieldlayoutelements/BaseField.php(215): craft\fieldlayoutelements\CustomField->inputHtml(Object(craft\elements\Entry), false)
#19 /var/www/backend/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(210): craft\fieldlayoutelements\BaseField->formHtml(Object(craft\elements\Entry), false)
#20 /var/www/backend/vendor/craftcms/cms/src/web/View.php(1544): craft\fieldlayoutelements\CustomField->craft\fieldlayoutelements\{closure}()
#21 /var/www/backend/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(211): craft\web\View->namespaceInputs(Object(Closure), 'fields')
#22 /var/www/backend/vendor/craftcms/cms/src/models/FieldLayout.php(681): craft\fieldlayoutelements\CustomField->formHtml(Object(craft\elements\Entry), false)
#23 /var/www/backend/vendor/craftcms/cms/src/web/View.php(1539): craft\models\FieldLayout->craft\models\{closure}()
#24 /var/www/backend/vendor/craftcms/cms/src/models/FieldLayout.php(680): craft\web\View->namespaceInputs(Object(Closure), NULL)
#25 /var/www/backend/vendor/craftcms/cms/src/controllers/ElementsController.php(717): craft\models\FieldLayout->createForm(Object(craft\elements\Entry), false, Array)
#26 /var/www/backend/vendor/craftcms/cms/src/controllers/ElementsController.php(426): craft\controllers\ElementsController->_prepareEditor(Object(craft\elements\Entry), true, Object(craft\web\Response), 'main-form', Object(Closure), Object(Closure), Object(Closure))
#27 [internal function]: craft\controllers\ElementsController->craft\controllers\{closure}(Object(craft\web\Response), 'main-form')
#28 /var/www/backend/vendor/craftcms/cms/src/web/CpScreenResponseFormatter.php(108): call_user_func(Object(Closure), Object(craft\web\Response), 'main-form')
#29 /var/www/backend/vendor/craftcms/cms/src/web/CpScreenResponseFormatter.php(48): craft\web\CpScreenResponseFormatter->_formatTemplate(Object(craft\web\Response), Object(craft\web\CpScreenResponseBehavior))
#30 /var/www/backend/vendor/yiisoft/yii2/web/Response.php(1095): craft\web\CpScreenResponseFormatter->format(Object(craft\web\Response))
#31 /var/www/backend/vendor/craftcms/cms/src/web/Response.php(275): yii\web\Response->prepare()
#32 /var/www/backend/vendor/yiisoft/yii2/web/Response.php(339): craft\web\Response->prepare()
#33 /var/www/backend/vendor/yiisoft/yii2/base/Application.php(390): yii\web\Response->send()
#34 /var/www/backend/web/index.php(9): yii\base\Application->run()
#35 {main}```

### Steps to reproduce

1. have 'generatePendingTransformsViaQueue' => false, in your app.php
2. open any entry

### Craft CMS version

4.0.2

### PHP version

8.0.17

### Operating system and version

craftcms/php-fpm:8.0-dev

### Database type and version

Mariadb 10.5

### Image driver and version

imageic

### Installed plugins and versions

Amazon S3 | 2.0.0
CP Field Inspect | 1.4.4
Position Fieldtype | 4.0.0-beta.3
Redactor | 3.0.0
SendGrid | 2.0.1
brandonkelly commented 2 years ago

We deprecated immediately: false for asset GraphQL queries in Craft 4 (and it no longer has any effect), which is what craft\services\Assets::$generatePendingTransformsViaQueue was added for, so that property has been removed in Craft 4.

We overlooked that for the initial 4.0.0 release notes, but I’ve retroactively added it.