spicywebau / craft-neo

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

Error trying to propagate Neo field after updating translation settings #868

Closed sleithart closed 3 months ago

sleithart commented 3 months ago

Bug Description

I switched a client over from an English-only to multiple sites—one English, one Spanish. When I update the Neo field I'm using as a page builder, I encounter this error on the Craft Queue.

I'm not entirely sure if this is a blocker to pushing out my changes, or if I need to wait until it's resolved to move forward? Is this something I can ignore? If not, can I take steps to resolve it, or do I need to wait for a plugin update?

2024-03-22 13:32:08 [queue.ERROR] [craft\queue\QueueLogBehavior::afterError]  [73198] t9n:["neo","Saving Neo block structures for duplicated elements"] (attempt: 1, pid: 2526) - Error (time: 13.209s): Invalid field handle: pageBuilder {"memory":222279024} 
2024-03-22 13:32:08 [queue.ERROR] [craft\errors\InvalidFieldException] craft\errors\InvalidFieldException: Invalid field handle: pageBuilder in /var/www/html/vendor/craftcms/cms/src/base/Element.php:5340
Stack trace:
#0 /var/www/html/vendor/craftcms/cms/src/base/Element.php(4173): craft\base\Element->normalizeFieldValue('pageBuilder')
#1 /var/www/html/vendor/spicyweb/craft-neo/src/jobs/ResaveFieldBlockStructures.php(62): craft\base\Element->getFieldValue('pageBuilder')
#2 /var/www/html/vendor/yiisoft/yii2-queue/src/Queue.php(243): benf\neo\jobs\ResaveFieldBlockStructures->execute(Object(craft\queue\Queue))
#3 /var/www/html/vendor/yiisoft/yii2-queue/src/cli/Queue.php(147): yii\queue\Queue->handleMessage('73198', 'O:40:"benf\\neo\\...', '300', 1)
#4 /var/www/html/vendor/craftcms/cms/src/queue/Queue.php(191): yii\queue\cli\Queue->handleMessage('73198', 'O:40:"benf\\neo\\...', '300', 1)
#5 /var/www/html/vendor/craftcms/cms/src/queue/Queue.php(166): craft\queue\Queue->executeJob()
#6 [internal function]: craft\queue\Queue->craft\queue\{closure}(Object(Closure))
#7 /var/www/html/vendor/yiisoft/yii2-queue/src/cli/Queue.php(117): call_user_func(Object(Closure), Object(Closure))
#8 /var/www/html/vendor/craftcms/cms/src/queue/Queue.php(174): yii\queue\cli\Queue->runWorker(Object(Closure))
#9 /var/www/html/vendor/craftcms/cms/src/controllers/QueueController.php(82): craft\queue\Queue->run()
#10 [internal function]: craft\controllers\QueueController->actionRun()
#11 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#13 /var/www/html/vendor/yiisoft/yii2/base/Module.php(553): yii\base\Controller->runAction('run', Array)
#14 /var/www/html/vendor/craftcms/cms/src/web/Application.php(341): yii\base\Module->runAction('queue/run', Array)
#15 /var/www/html/vendor/craftcms/cms/src/web/Application.php(642): craft\web\Application->runAction('queue/run', Array)
#16 /var/www/html/vendor/craftcms/cms/src/web/Application.php(303): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#17 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#18 /var/www/html/web/index.php(12): yii\base\Application->run()

Steps to reproduce

  1. On a Neo Field in the admin site, change the propagation method (I switched from Save blocks to all sites the owner element is saved in to Only save blocks to the site they were created in)
  2. Allow the queue to run its process of updating current content on the site
  3. Queue errors before finishing—check the logs for the above error

Expected behaviour

I would expect this to propagate properly

Neo version

4.0.8

Craft CMS version

4.8.4

What is the affected Neo field's propagation method?

I changed it, which threw the error (see above)

Does this issue involve templating, and if so, is eager-loading used?

This is not a templating issue

ttempleton commented 3 months ago

Thanks for reporting this - should be fixed now for the next release. In the meantime, you can get the fix by setting your composer.json file's spicyweb/craft-neo requirement to 4.x-dev as 4.0.8 and running composer update.

sleithart commented 3 months ago

Worked great, thanks for the quick fix!

On March 25, 2024, "height[bot]" @.***> wrote:

Thanks for reporting this - should be fixed now for the next release. In the meantime, you can get the fix by setting your composer.json file's spicyweb/craft-neo requirement to 4.x-dev as 4.0.8 and running composer update.

— Reply to this email directly, view it on GitHub https://github.com/spicywebau/craft-neo/issues/868#issuecomment- 2019201061, or unsubscribe https://github.com/notifications/unsubscribe- auth/AAIOXBNJXEWS4TZFYIDWRP3Y2DCHTAVCNFSM6AAAAABFHZHFZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJZGIYDCMBWGE. You are receiving this because you authored the thread.Message ID: @.***>