Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x]: Entry edit from CP throwing error #16522

Open
bhashkar007 opened this issue Jan 25, 2025 · 1 comment
Open

[5.x]: Entry edit from CP throwing error #16522

bhashkar007 opened this issue Jan 25, 2025 · 1 comment
Labels

Comments

@bhashkar007
Copy link

What happened?

Description

Recently, I updated a Craft 2 website to Craft 5 (multi-language). I am getting error for some blog entries while opening to edit from CP:

TypeError: craft\helpers\Cp::elementChipHtml(): Argument #1 ($element) must be of type craft\base\ElementInterface, array given, called in /var/www/html/storage/runtime/compiled_templates/3d/3d905a0016b5a6f9e5dc4ded88cd7ed7.php on line 67 and defined in /var/www/html/vendor/craftcms/cms/src/helpers/Cp.php:512
Stack trace:
#0 /var/www/html/storage/runtime/compiled_templates/3d/3d905a0016b5a6f9e5dc4ded88cd7ed7.php(67): craft\helpers\Cp::elementChipHtml()
#1 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(2058): __TwigTemplate_ce3d8282d134df04f66a307574d39544->{closure}()
#2 /var/www/html/storage/runtime/compiled_templates/3d/3d905a0016b5a6f9e5dc4ded88cd7ed7.php(54): Twig\Extension\CoreExtension::captureOutput()
#3 /var/www/html/vendor/twig/twig/src/Template.php(387): __TwigTemplate_ce3d8282d134df04f66a307574d39544->doDisplay()
#4 /var/www/html/vendor/twig/twig/src/Template.php(343): Twig\Template->yield()
#5 /var/www/html/vendor/twig/twig/src/Template.php(358): Twig\Template->display()
#6 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render()
#7 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(1479): Twig\TemplateWrapper->render()
#8 /var/www/html/storage/runtime/compiled_templates/57/5731776400234ccd63a3b3d4a3b48c56.php(146): Twig\Extension\CoreExtension::include()
#9 /var/www/html/vendor/twig/twig/src/Template.php(387): __TwigTemplate_8271091ae0fda11bdef5447061bf64b2->doDisplay()
#10 /var/www/html/storage/runtime/compiled_templates/cf/cf6e5470980d0c27a0566a718afaab40.php(893): Twig\Template->yield()
#11 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(2058): __TwigTemplate_9e64fa6cdea60bd520663a955c71be66->{closure}()
#12 /var/www/html/storage/runtime/compiled_templates/cf/cf6e5470980d0c27a0566a718afaab40.php(889): Twig\Extension\CoreExtension::captureOutput()
#13 /var/www/html/storage/runtime/compiled_templates/34/34d740f24754ad530bbfd70e5d2441a4.php(114): __TwigTemplate_9e64fa6cdea60bd520663a955c71be66->macro_elementSelect()
#14 /var/www/html/vendor/twig/twig/src/Template.php(387): __TwigTemplate_0ec56bceb17407222c6da524624d3035->doDisplay()
#15 /var/www/html/vendor/twig/twig/src/Template.php(343): Twig\Template->yield()
#16 /var/www/html/vendor/twig/twig/src/Template.php(358): Twig\Template->display()
#17 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render()
#18 /var/www/html/vendor/twig/twig/src/Environment.php(320): Twig\TemplateWrapper->render()
#19 /var/www/html/vendor/craftcms/cms/src/web/View.php(576): Twig\Environment->render()
#20 /var/www/html/vendor/barrelstrength/sprout/src/meta/components/meta/OpenGraphMetaType.php(114): craft\web\View->renderTemplate()
#21 /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php(1861): BarrelStrength\Sprout\meta\components\meta\OpenGraphMetaType->getSettingsHtml()
#22 /var/www/html/vendor/craftcms/cms/src/helpers/Template.php(148): Twig\Extension\CoreExtension::getAttribute()
#23 /var/www/html/storage/runtime/compiled_templates/57/579707c1c29f32a978825fa3637d8955.php(224): craft\helpers\Template::attribute()
#24 /var/www/html/vendor/twig/twig/src/Template.php(387): __TwigTemplate_9643ae48cc225d78dc1e51e02a144ea5->doDisplay()
#25 /var/www/html/vendor/twig/twig/src/Template.php(343): Twig\Template->yield()
#26 /var/www/html/vendor/twig/twig/src/Template.php(358): Twig\Template->display()
#27 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render()
#28 /var/www/html/vendor/twig/twig/src/Environment.php(320): Twig\TemplateWrapper->render()
#29 /var/www/html/vendor/craftcms/cms/src/web/View.php(576): Twig\Environment->render()
#30 /var/www/html/vendor/barrelstrength/sprout/src/meta/components/fields/ElementMetadataField.php(147): craft\web\View->renderTemplate()
#31 /var/www/html/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(406): BarrelStrength\Sprout\meta\components\fields\ElementMetadataField->getInputHtml()
#32 /var/www/html/vendor/craftcms/cms/src/fieldlayoutelements/BaseField.php(365): craft\fieldlayoutelements\CustomField->inputHtml()
#33 /var/www/html/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(357): craft\fieldlayoutelements\BaseField->formHtml()
#34 /var/www/html/vendor/craftcms/cms/src/web/View.php(1885): craft\fieldlayoutelements\CustomField->craft\fieldlayoutelements\{closure}()
#35 /var/www/html/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(356): craft\web\View->namespaceInputs()
#36 /var/www/html/vendor/craftcms/cms/src/models/FieldLayout.php(1013): craft\fieldlayoutelements\CustomField->formHtml()
#37 /var/www/html/vendor/craftcms/cms/src/web/View.php(1879): craft\models\FieldLayout->craft\models\{closure}()
#38 /var/www/html/vendor/craftcms/cms/src/models/FieldLayout.php(1012): craft\web\View->namespaceInputs()
#39 /var/www/html/vendor/craftcms/cms/src/controllers/ElementsController.php(1013): craft\models\FieldLayout->createForm()
#40 /var/www/html/vendor/craftcms/cms/src/controllers/ElementsController.php(406): craft\controllers\ElementsController->_prepareEditor()
#41 [internal function]: craft\controllers\ElementsController->craft\controllers\{closure}()
#42 /var/www/html/vendor/craftcms/cms/src/web/CpScreenResponseFormatter.php(125): call_user_func()
#43 /var/www/html/vendor/craftcms/cms/src/web/CpScreenResponseFormatter.php(50): craft\web\CpScreenResponseFormatter->_formatTemplate()
#44 /var/www/html/vendor/yiisoft/yii2/web/Response.php(1109): craft\web\CpScreenResponseFormatter->format()
#45 /var/www/html/vendor/craftcms/cms/src/web/Response.php(341): yii\web\Response->prepare()
#46 /var/www/html/vendor/yiisoft/yii2/web/Response.php(340): craft\web\Response->prepare()
#47 /var/www/html/vendor/yiisoft/yii2/base/Application.php(390): yii\web\Response->send()
#48 /var/www/html/public/index.php(12): yii\base\Application->run()
#49 {main}

Steps to reproduce

  1. Craft 2 to Craft 5 update
  2. Open entry to edit from CP

Craft CMS version

Craft Pro 5.6.1

PHP version

8.3.14

Operating system and version

Linux 6.8.0-51-generic

Database type and version

MySQL 8.0.40

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.12-98)

Installed plugins and versions

  • Amazon S3 2.2.1
  • Blitz 5.9.9
  • Cache Warmer 3.0.0
  • Cookies 5.0.0
  • Element API 4.2.0
  • Embedded Assets 5.4.1
  • Enupal Translate 4.1.1
  • Expanded Singles 3.0.1
  • Feed Me 6.6.1
  • Field Manager 4.0.3
  • First Image 2.0.0
  • Guest Entries 4.0.1
  • Navigation 3.0.5
  • Neo 5.2.22
  • oEmbed 3.1.3
  • Order Form Generator 2.0.0
  • Parse Tags 2.0.0
  • Redactor 4.2.0
  • Site Switcher 3.0.0
  • Sprout SEO 5.0.0-beta.1
  • Stripe Payments 6.0.2
  • Stripe Payments 2.0.0
  • Typogrify 5.0.1
  • Workflow 3.0.5
@brandonkelly
Copy link
Member

brandonkelly commented Jan 26, 2025

Try reproducing the error when dev mode is enabled. You should get an exception view with a full stack trace with code snippets. Can you please save that page’s HTML and send it to [email protected]?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants