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

PHP Notice – yii\base\ErrorException Undefined index: titleRaw #176

Closed
nicolasbinet opened this issue Jan 22, 2019 · 7 comments
Closed

Comments

@nicolasbinet
Copy link

nicolasbinet commented Jan 22, 2019

Description

After Craft 3.1 update & SEO plugin update, the create screens fail

Steps to reproduce

  1. Create a category
  2. Add SEO field to it's fields
  3. Try to create a category
yii\base\ErrorException: Undefined index: titleRaw in /Users/nicolas/Code/La Briqueterie - v2/vendor/ether/seo/src/models/data/SeoData.php:143
Stack trace:
#0 /Users/nicolas/Code/La Briqueterie - v2/vendor/ether/seo/src/fields/SeoField.php(101): ether\seo\models\data\SeoData->__construct()
#1 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/base/Element.php(2007): ether\seo\fields\SeoField->normalizeValue()
#2 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/base/Element.php(1645): craft\elements\Category->normalizeFieldValue()
#3 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Extension/Core.php(1626): craft\elements\Category->getFieldValue()
#4 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/helpers/Template.php(73): ::twig_get_attribute()
#5 /Users/nicolas/Code/La Briqueterie - v2/storage/runtime/compiled_templates/9e/9ef94ca5564e5c25a44b763ad8026d2807dfacbd6b589a11dcc1e66e35e0dab8.php(30): craft\helpers\Template::attribute()
#6 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(386): __TwigTemplate_c26eca64f36452ac6dd74edc865570fcea766efb17879eefcbd1769bb17e5278->doDisplay()
#7 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/twig/Template.php(49): __TwigTemplate_c26eca64f36452ac6dd74edc865570fcea766efb17879eefcbd1769bb17e5278->displayWithErrorHandling()
#8 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(363): __TwigTemplate_c26eca64f36452ac6dd74edc865570fcea766efb17879eefcbd1769bb17e5278->displayWithErrorHandling()
#9 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/twig/Template.php(31): __TwigTemplate_c26eca64f36452ac6dd74edc865570fcea766efb17879eefcbd1769bb17e5278->display()
#10 /Users/nicolas/Code/La Briqueterie - v2/storage/runtime/compiled_templates/18/18cafc1fc0c26f8d8169221809fb07d0f305f4e9f3b16b203f5dca54c1236b4e.php(47): __TwigTemplate_c26eca64f36452ac6dd74edc865570fcea766efb17879eefcbd1769bb17e5278->display()
#11 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(386): __TwigTemplate_12bb015c2c7dbcd71ce95ce97d34b5167d9dba3af7c70dbe1a65c6d232a75844->doDisplay()
#12 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/twig/Template.php(49): __TwigTemplate_12bb015c2c7dbcd71ce95ce97d34b5167d9dba3af7c70dbe1a65c6d232a75844->displayWithErrorHandling()
#13 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(363): __TwigTemplate_12bb015c2c7dbcd71ce95ce97d34b5167d9dba3af7c70dbe1a65c6d232a75844->displayWithErrorHandling()
#14 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/twig/Template.php(31): __TwigTemplate_12bb015c2c7dbcd71ce95ce97d34b5167d9dba3af7c70dbe1a65c6d232a75844->display()
#15 /Users/nicolas/Code/La Briqueterie - v2/storage/runtime/compiled_templates/d5/d52a1889e0d84e34073cdce1da676d48611314d21fdc281e315a2344a2e39ed6.php(267): __TwigTemplate_12bb015c2c7dbcd71ce95ce97d34b5167d9dba3af7c70dbe1a65c6d232a75844->display()
#16 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(189): __TwigTemplate_9d36e37ee8004df2d4e459763971e0b1797befdc7167b679da7212ca092ed928->block_content()
#17 /Users/nicolas/Code/La Briqueterie - v2/storage/runtime/compiled_templates/34/34528b4284f142416039b1727ae2f961d50ae8adda2acfdc4dcada4e5646fc2f.php(648): __TwigTemplate_6267ef4b770d972e8571c5a7cfea579a4a09aa73eb04f516d9c273c3afb85a9a->displayBlock()
#18 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(189): __TwigTemplate_6267ef4b770d972e8571c5a7cfea579a4a09aa73eb04f516d9c273c3afb85a9a->block_main()
#19 /Users/nicolas/Code/La Briqueterie - v2/storage/runtime/compiled_templates/34/34528b4284f142416039b1727ae2f961d50ae8adda2acfdc4dcada4e5646fc2f.php(533): __TwigTemplate_6267ef4b770d972e8571c5a7cfea579a4a09aa73eb04f516d9c273c3afb85a9a->displayBlock()
#20 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(189): __TwigTemplate_6267ef4b770d972e8571c5a7cfea579a4a09aa73eb04f516d9c273c3afb85a9a->block_body()
#21 /Users/nicolas/Code/La Briqueterie - v2/storage/runtime/compiled_templates/6d/6d5118e80f5c48f54c36f1fb03456553b5844bd74a9e8308f2fec926b2611fc7.php(60): __TwigTemplate_ac6c6f57cc2d6a2dac05fa5b04b241796acc5b19962d27d78a27fb61898024a2->displayBlock()
#22 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(386): __TwigTemplate_ac6c6f57cc2d6a2dac05fa5b04b241796acc5b19962d27d78a27fb61898024a2->doDisplay()
#23 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/twig/Template.php(49): __TwigTemplate_ac6c6f57cc2d6a2dac05fa5b04b241796acc5b19962d27d78a27fb61898024a2->displayWithErrorHandling()
#24 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(363): __TwigTemplate_ac6c6f57cc2d6a2dac05fa5b04b241796acc5b19962d27d78a27fb61898024a2->displayWithErrorHandling()
#25 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/twig/Template.php(31): __TwigTemplate_ac6c6f57cc2d6a2dac05fa5b04b241796acc5b19962d27d78a27fb61898024a2->display()
#26 /Users/nicolas/Code/La Briqueterie - v2/storage/runtime/compiled_templates/52/5230c5fae02b9097637133fe02254b9eaac24862ecdeb1ae5d29328d74072a05.php(40): __TwigTemplate_ac6c6f57cc2d6a2dac05fa5b04b241796acc5b19962d27d78a27fb61898024a2->display()
#27 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(386): __TwigTemplate_6b8132fdaf32a3f9f0547540d23b6901c7c9d4e9625a39c22d9bbe54ec7ead0d->doDisplay()
#28 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/twig/Template.php(49): __TwigTemplate_6b8132fdaf32a3f9f0547540d23b6901c7c9d4e9625a39c22d9bbe54ec7ead0d->displayWithErrorHandling()
#29 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(363): __TwigTemplate_6b8132fdaf32a3f9f0547540d23b6901c7c9d4e9625a39c22d9bbe54ec7ead0d->displayWithErrorHandling()
#30 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/twig/Template.php(31): __TwigTemplate_6b8132fdaf32a3f9f0547540d23b6901c7c9d4e9625a39c22d9bbe54ec7ead0d->display()
#31 /Users/nicolas/Code/La Briqueterie - v2/storage/runtime/compiled_templates/34/34528b4284f142416039b1727ae2f961d50ae8adda2acfdc4dcada4e5646fc2f.php(95): __TwigTemplate_6b8132fdaf32a3f9f0547540d23b6901c7c9d4e9625a39c22d9bbe54ec7ead0d->display()
#32 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(386): __TwigTemplate_6267ef4b770d972e8571c5a7cfea579a4a09aa73eb04f516d9c273c3afb85a9a->doDisplay()
#33 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/twig/Template.php(49): __TwigTemplate_6267ef4b770d972e8571c5a7cfea579a4a09aa73eb04f516d9c273c3afb85a9a->displayWithErrorHandling()
#34 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(363): __TwigTemplate_6267ef4b770d972e8571c5a7cfea579a4a09aa73eb04f516d9c273c3afb85a9a->displayWithErrorHandling()
#35 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/twig/Template.php(31): __TwigTemplate_6267ef4b770d972e8571c5a7cfea579a4a09aa73eb04f516d9c273c3afb85a9a->display()
#36 /Users/nicolas/Code/La Briqueterie - v2/storage/runtime/compiled_templates/d5/d52a1889e0d84e34073cdce1da676d48611314d21fdc281e315a2344a2e39ed6.php(55): __TwigTemplate_6267ef4b770d972e8571c5a7cfea579a4a09aa73eb04f516d9c273c3afb85a9a->display()
#37 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(386): __TwigTemplate_9d36e37ee8004df2d4e459763971e0b1797befdc7167b679da7212ca092ed928->doDisplay()
#38 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/twig/Template.php(49): __TwigTemplate_9d36e37ee8004df2d4e459763971e0b1797befdc7167b679da7212ca092ed928->displayWithErrorHandling()
#39 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(363): __TwigTemplate_9d36e37ee8004df2d4e459763971e0b1797befdc7167b679da7212ca092ed928->displayWithErrorHandling()
#40 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/twig/Template.php(31): __TwigTemplate_9d36e37ee8004df2d4e459763971e0b1797befdc7167b679da7212ca092ed928->display()
#41 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Template.php(371): __TwigTemplate_9d36e37ee8004df2d4e459763971e0b1797befdc7167b679da7212ca092ed928->display()
#42 /Users/nicolas/Code/La Briqueterie - v2/vendor/twig/twig/lib/Twig/Environment.php(289): __TwigTemplate_9d36e37ee8004df2d4e459763971e0b1797befdc7167b679da7212ca092ed928->render()
#43 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/View.php(337): craft\web\twig\Environment->render()
#44 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/View.php(384): craft\web\View->renderTemplate()
#45 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/Controller.php(161): craft\web\View->renderPageTemplate()
#46 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/controllers/CategoriesController.php(407): craft\controllers\CategoriesController->renderTemplate()
#47 /Users/nicolas/Code/La Briqueterie - v2/vendor/yiisoft/yii2/base/InlineAction.php(57): craft\controllers\CategoriesController->actionEditCategory()
#48 /Users/nicolas/Code/La Briqueterie - v2/vendor/yiisoft/yii2/base/InlineAction.php(57): ::call_user_func_array:{/Users/nicolas/Code/La Briqueterie - v2/vendor/yiisoft/yii2/base/InlineAction.php:57}()
#49 /Users/nicolas/Code/La Briqueterie - v2/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams()
#50 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/Controller.php(109): craft\controllers\CategoriesController->runAction()
#51 /Users/nicolas/Code/La Briqueterie - v2/vendor/yiisoft/yii2/base/Module.php(528): craft\controllers\CategoriesController->runAction()
#52 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/Application.php(297): craft\web\Application->runAction()
#53 /Users/nicolas/Code/La Briqueterie - v2/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction()
#54 /Users/nicolas/Code/La Briqueterie - v2/vendor/craftcms/cms/src/web/Application.php(286): craft\web\Application->handleRequest()
#55 /Users/nicolas/Code/La Briqueterie - v2/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest()
#56 /Users/nicolas/Code/La Briqueterie - v2/web/index.php(21): craft\web\Application->run()
#57 {main}

Additional info

  • Craft version: 3.1.3
  • SEO version: 3.5.2
  • PHP version: 7.1.25
  • Database driver & version: mysql
@nicolasbinet nicolasbinet changed the title unknown property: craft\elements\Category::typeId PHP Notice – yii\base\ErrorException Undefined index: titleRaw Jan 22, 2019
@jonXmack
Copy link

I have the same issue, however mine's appearing on the front end no matter what, and on the back end if the SEO field is present on an entry.

@nicolasbinet
Copy link
Author

I've also just had the case on the frondend, when the URLs is neither a category nor an entry, but just a single template.

@RoyVeldman
Copy link

I got the same issue

@makereadyisaac
Copy link

Same issue here, but works on one site and fails on the other, both updated to current builds

@JoshMustafa
Copy link

did any of you guys manage to find a fix ?

@23d1
Copy link

23d1 commented Jan 23, 2019

Getting the same issue simply trying to load CSS-files. Whether it's loading as a link or directly navigating to the css-file;

PHP Notice 'yii\base\ErrorException' with message 'Undefined index: titleRaw' 

in /craft/vendor/ether/seo/src/models/data/SeoData.php:143

Stack trace:
#0 /craft/vendor/craftcms/cms/src/web/ErrorHandler.php(76): yii\base\ErrorHandler->handleError(8, 'Undefined index...', '/Sites/...', 143)
#1 /craft/vendor/ether/seo/src/models/data/SeoData.php(143): craft\web\ErrorHandler->handleError(8, 'Undefined index...', '/Sites/...', 143, Array)
#2 /craft/vendor/ether/seo/src/services/SeoService.php(113): ether\seo\models\data\SeoData->__construct()
#3 /craft/vendor/ether/seo/src/services/SeoService.php(57): ether\seo\services\SeoService->_getElementAndSeoFields()
#4 /craft/vendor/ether/seo/src/Seo.php(300): ether\seo\services\SeoService->injectCanonical()
#5 [internal function]: ether\seo\Seo->onAfterRequest(Object(yii\base\Event))
#6 /craft/vendor/yiisoft/yii2/base/Event.php(310): call_user_func(Array, Object(yii\base\Event))
#7 /craft/vendor/yiisoft/yii2/base/Component.php(636): yii\base\Event::trigger('craft\\web\\Appli...', 'afterRequest', Object(yii\base\Event))
#8 /craft/vendor/yiisoft/yii2/base/Application.php(389): yii\base\Component->trigger('afterRequest')
#9 /web/index.php(21): yii\base\Application->run()

Tested on multiple installs.

@jonXmack
Copy link

Let me first say that I am not a PHP developer in any way at all, however, modifying lines 140-144 to the below allows me to continue to develop the site I'm working on until an actual fix comes out.

if (array_key_exists('titleRaw', $config) && is_string($config['titleRaw']))
{
	$config['titleRaw'] = [$config['titleRaw']];
	$config['titleRaw'] = array_filter($config['titleRaw']);
}

@Tam Tam closed this as completed in 2c5e484 Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants