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] Adding more than 2 elements to a Neo block throws an error: 'There was a problem getting the previous element.' #979

Open
AleksanderKampus1 opened this issue Jan 7, 2025 · 2 comments

Comments

@AleksanderKampus1
Copy link

AleksanderKampus1 commented Jan 7, 2025

Bug Description

While working on an entry that is already saved once, I can't add more than 1 block to the parent Neo block. When I try to do it I get Request failed with status code 500. And looking at the logs I see this error 'There was a problem getting the previous element.' Here is the stack trace if it helps:

#0 /app/vendor/spicyweb/craft-neo/src/controllers/Input.php(146): craft\services\Structures->moveAfter(341200, Object(benf\neo\elements\Block), 17071011)
#1 [internal function]: benf\neo\controllers\Input->actionRenderBlocks()
#2 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /app/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#4 /app/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('render-blocks', Array)
#5 /app/vendor/craftcms/cms/src/web/Application.php(350): yii\base\Module->runAction('neo/input/rende...', Array)
#6 /app/vendor/craftcms/cms/src/web/Application.php(649): craft\web\Application->runAction('neo/input/rende...', Array)
#7 /app/vendor/craftcms/cms/src/web/Application.php(312): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#8 /app/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#9 /app/web/index.php(83): yii\base\Application->run()
#10 {main}

Steps to reproduce

  1. Make a new entry
  2. Add some blocks to it (try adding multiple inside one block)
  3. Everything should work fine
  4. Now save the entry
  5. Try to adding a new block and inside it multiple new ones
  6. You should get Request failed with status code 500

Auto save drafts is set to false if that changes anything

Added also a video where you can see a totally new entry where I can add multiple Neo blocks. However when I save and try to do it again then I get 500.

Screen.Recording.Jan.7.2025.2.mp4

Expected behaviour

I can add multiple blocks inside a Neo block

Neo version

5.2.21

Craft CMS version

5.5.8

What is the affected Neo field's propagation method?

No response

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

This is not a templating issue

@AleksanderKampus1
Copy link
Author

It works in 5.2.13

@ttempleton ttempleton added bug report status: confirmed A bug report that has been reproduced by the maintainer(s), but has not yet been fixed and removed bug report status: new labels Jan 10, 2025
@ttempleton
Copy link
Contributor

Thanks for reporting that - fixed for the next release.

@ttempleton ttempleton added bug report status: fixed and removed bug report status: confirmed A bug report that has been reproduced by the maintainer(s), but has not yet been fixed labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants