spicywebau / craft-neo

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

Adding block not executing: loading spinner keeps spinning #801

Closed eikhart closed 1 year ago

eikhart commented 1 year ago

Bug Description

Have a multisite setup. Neo works just fine in site A site B is in the same site group, but another language

I try to add a new entry to site B, but a new Neo block is not created. Instead the loading spinner keeps loading.

Good to know, possibly related: within the neo block, an entry field is used (i use it to wrap a link around the block that points to a related entry). Why possibly related? Because that is the big difference betwene site A and site B: site B doesn't have entries in this section yet

In console.log in can see that script hangs on this bit of code:

Input.js, line 1155:

  this._animateSpinnerThen(async () => {
    await e.blockType.loadTabs()
    createTheBlock()
  })

So it seems that Tabs aren’t loaded. I have no idea why tbh

Steps to reproduce

  1. edit entry
  2. add Neo block

Expected behaviour

No response

Neo version

3.9.4

Craft CMS version

Craftcms pro 4.5.6.1

What is the affected Neo field's propagation method?

Well, tried all of them. Currently using ‘Save block to all sites the owner element is saved in'

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

This is not a templating issue

ttempleton commented 1 year ago

Are there any errors in your web browser's network monitor or in the Craft logs involving Neo?

eikhart commented 1 year ago

Console:

Screenshot 2023-10-05 at 09 11 20 Screenshot 2023-10-05 at 09 11 44

I found this in web-log, at the same moment I made the request:

2023-10-05 07:15:11 [web.INFO] [yii\db\Connection::open] Opening DB connection: mysql:host=db;dbname=db;port=3306 {"memory":1853088} 2023-10-05 07:15:11 [web.INFO] [yii\web\Session::open] Session started {"memory":3607288} 2023-10-05 07:15:11 [web.INFO] [nystudio107\codeeditor\CodeEditor::bootstrap] CodeEditor module bootstrapped {"memory":3850768} 2023-10-05 07:15:11 [web.INFO] [nystudio107\codefield\CodeField::init] Code Field plugin loaded {"memory":4209328} 2023-10-05 07:15:11 [web.INFO] [lilthq\craftliltplugin\Craftliltplugin::init] Lilt plugin loaded {"memory":5876552} 2023-10-05 07:15:11 [web.INFO] [nystudio107\emptycoalesce\EmptyCoalesce::init] Empty Coalesce plugin loaded {"memory":5965640} 2023-10-05 07:15:11 [web.INFO] [jalendport\fetch\Fetch::init] Fetch plugin loaded {"memory":6043512} 2023-10-05 07:15:11 [web.INFO] [mmikkel\retcon\Retcon::init] Retcon plugin loaded {"memory":6901192} 2023-10-05 07:15:11 [web.INFO] [craftsnippets\tableofcontents\TableOfContents::init] Table of contents plugin loaded {"memory":7374104} 2023-10-05 07:15:11 [web.WARNING] [craft\web\View::createTwig] Twig instantiated before Craft is fully initialized. {"memory":7490000} 2023-10-05 07:15:11 [web.WARNING] [craft\elements\db\ElementQuery::prepare] Element query executed before Craft is fully initialized. Stack trace:

0 /var/www/html/vendor/yiisoft/yii2/db/QueryBuilder.php(227): craft\elements\db\ElementQuery->prepare()

1 /var/www/html/vendor/yiisoft/yii2/db/Query.php(157): yii\db\QueryBuilder->build()

2 /var/www/html/vendor/yiisoft/yii2/db/Query.php(287): yii\db\Query->createCommand()

3 /var/www/html/vendor/craftcms/cms/src/db/Query.php(275): yii\db\Query->one()

4 /var/www/html/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1604): craft\db\Query->one()

5 /var/www/html/vendor/craftcms/cms/src/elements/User.php(545): craft\elements\db\ElementQuery->one()

6 /var/www/html/vendor/yiisoft/yii2/web/User.php(698): craft\elements\User::findIdentity()

7 /var/www/html/vendor/craftcms/cms/src/web/User.php(489): yii\web\User->renewAuthStatus()

8 /var/www/html/vendor/yiisoft/yii2/web/User.php(199): craft\web\User->renewAuthStatus()

9 /var/www/html/vendor/craftcms/cms/src/web/twig/Extension.php(1624): yii\web\User->getIdentity()

10 /var/www/html/vendor/twig/twig/src/ExtensionSet.php(320): craft\web\twig\Extension->getGlobals()

11 /var/www/html/vendor/twig/twig/src/Environment.php(783): Twig\ExtensionSet->getGlobals()

12 /var/www/html/vendor/twig/twig/src/Environment.php(796): Twig\Environment->getGlobals()

13 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\Environment->mergeGlobals()

14 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\Template->display()

15 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(40): Twig\Template->render()

16 /var/www/html/vendor/twig/twig/src/Environment.php(277): Twig\TemplateWrapper->render()

17 /var/www/html/vendor/craftcms/cms/src/web/View.php(474): Twig\Environment->render()

18 /var/www/html/vendor/verbb/social-login/src/services/Service.php(88): craft\web\View->renderTemplate()

19 verbb\sociallogin\services\Service->verbb\sociallogin\services{closure}()

20 /var/www/html/vendor/yiisoft/yii2/base/Event.php(312): call_user_func()

21 /var/www/html/vendor/yiisoft/yii2/base/Component.php(642): yii\base\Event::trigger()

22 /var/www/html/vendor/craftcms/cms/src/services/Plugins.php(275): yii\base\Component->trigger()

23 /var/www/html/vendor/craftcms/cms/src/base/ApplicationTrait.php(1595): craft\services\Plugins->loadPlugins()

24 /var/www/html/vendor/craftcms/cms/src/web/Application.php(108): craft\web\Application->_postInit()

25 /var/www/html/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\web\Application->init()

26 /var/www/html/vendor/yiisoft/yii2/base/Application.php(204): yii\base\BaseObject->__construct()

27 yii\base\Application->__construct()

28 /var/www/html/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs()

29 /var/www/html/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build()

30 /var/www/html/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get()

31 /var/www/html/vendor/craftcms/cms/src/Craft.php(54): yii\BaseYii::createObject()

32 /var/www/html/vendor/craftcms/cms/bootstrap/bootstrap.php(258): Craft::createObject()

33 /var/www/html/vendor/craftcms/cms/bootstrap/web.php(40): require()

34 /var/www/html/web/index.php(11): require() {"memory":7627096}

2023-10-05 07:15:11 [web.INFO] [application] Request context: $_GET = [ 'p' => 'admin/actions/elements/recent-activity' 'site' => 'com' 'dontExtendSession' => '1' 'v' => '1696490111213' ]

ttempleton commented 1 year ago

If possible, could you please send your composer.json/lock and database backup to plugins@spicyweb.com.au, along with information about which site/section this happens with, and we'll have a look at it.

eikhart commented 1 year ago

Cool, the latest update to "spicyweb/craft-neo": "3.9.5", seems to have squished this bug :) \0/

ttempleton commented 1 year ago

Oh awesome, I'm guessing it was related to us not passing through the site ID when lazy loading new blocks, which had some other side effects as well (e.g. issue with entries fields #800). I'll update the changelog to note this is fixed in 3.9.5, but please do let me know if it happens again.