spicywebau / craft-neo

A Matrix-like field type for Craft CMS that uses existing fields
Other
402 stars 63 forks source link

Invalid Argument – yii\base\InvalidArgumentException EntryTitleField can only be used in entry field layouts. #408

Closed viooolDN closed 4 years ago

viooolDN commented 4 years ago

Description

After updating Craft and Neo, the following error shows when opening/creating an Entry.

Invalid Argument – yii\base\InvalidArgumentException
EntryTitleField can only be used in entry field layouts.

See the following fix in Craft: https://github.com/craftcms/cms/issues/6503

Steps to reproduce

  1. Update Craft CMS from 3.5.11.1 => 3.5.14
  2. Update neo from 2.7.25 => 2.8.12
  3. Open or create an Entry in Craft CMS

Other information

Stack trace:

0 /var/www/html/craft3/vendor/craftcms/cms/src/fieldlayoutelements/BaseField.php(202): craft\fieldlayoutelements\EntryTitleField->inputHtml(Object(benf\neo\elements\Block), false)

1 /var/www/html/craft3/vendor/spicyweb/craft-neo/src/services/Blocks.php(121): craft\fieldlayoutelements\BaseField->formHtml(Object(benf\neo\elements\Block), false)

2 /var/www/html/craft3/vendor/spicyweb/craft-neo/src/services/BlockTypes.php(573): benf\neo\services\Blocks->renderTabs(Object(benf\neo\elements\Block), false, 'fields[dashboar...')

3 /var/www/html/craft3/vendor/spicyweb/craft-neo/src/assets/FieldAsset.php(288): benf\neo\services\BlockTypes->renderTabs(Object(benf\neo\models\BlockType), false, NULL, 1, Object(craft\elements\GlobalSet))

4 /var/www/html/craft3/vendor/spicyweb/craft-neo/src/assets/FieldAsset.php(153): benf\neo\assets\FieldAsset::_getBlockTypesJsSettings(Array, true, false, 1, Object(craft\elements\GlobalSet))

5 /var/www/html/craft3/vendor/spicyweb/craft-neo/src/Field.php(883): benf\neo\assets\FieldAsset::createInputJs(Object(benf\neo\Field), Array, false, 1, Object(craft\elements\GlobalSet))

6 /var/www/html/craft3/vendor/spicyweb/craft-neo/src/Field.php(340): benf\neo\Field->_getInputHtml(Array, Object(craft\elements\GlobalSet))

7 /var/www/html/craft3/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(251): benf\neo\Field->getInputHtml(Object(benf\neo\elements\db\BlockQuery), Object(craft\elements\GlobalSet))

8 /var/www/html/craft3/vendor/craftcms/cms/src/fieldlayoutelements/BaseField.php(202): craft\fieldlayoutelements\CustomField->inputHtml(Object(craft\elements\GlobalSet), false)

9 /var/www/html/craft3/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(227): craft\fieldlayoutelements\BaseField->formHtml(Object(craft\elements\GlobalSet), false)

10 /var/www/html/craft3/vendor/craftcms/cms/src/models/FieldLayout.php(476): craft\fieldlayoutelements\CustomField->formHtml(Object(craft\elements\GlobalSet), false)

11 /var/www/html/craft3/vendor/craftcms/cms/src/controllers/GlobalsController.php(206): craft\models\FieldLayout->createForm(Object(craft\elements\GlobalSet))

12 [internal function]: craft\controllers\GlobalsController->actionEditContent('dashboard', NULL, Object(craft\elements\GlobalSet))

13 /var/www/html/craft3/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)

14 /var/www/html/craft3/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)

15 /var/www/html/craft3/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction('edit-content', Array)

16 /var/www/html/craft3/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('edit-content', Array)

17 /var/www/html/craft3/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction('globals/edit-co...', Array)

18 /var/www/html/craft3/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('globals/edit-co...', Array)

19 /var/www/html/craft3/vendor/craftcms/cms/src/web/Application.php(259): yii\web\Application->handleRequest(Object(craft\web\Request))

20 /var/www/html/craft3/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))

21 /var/www/html/craft3/web/index.php(26): yii\base\Application->run()

22 {main}

ttempleton commented 4 years ago

I was unable to reproduce this error, but it should never be possible to have an EntryTitleField on a Neo block type's field layout -- indeed there is nothing in Neo that references EntryTitleField in any way.

Does that field appear on the field layout when editing the affected block type? If it does appear, can it be dragged out? If it doesn't appear, does resaving the Neo field resolve the issue?

viooolDN commented 4 years ago

Hello Thomas, Thank you for your answer. Resaving the Neo fields did the trick!