Cms: Error when saving an entry: Element 44 could not be duplicated for site 2: Slug cannot be blank.

Created on 16 Oct 2019  路  1Comment  路  Source: craftcms/cms

Description

I have v3.4.x-dev running and had this problem prior to the current one: https://github.com/craftcms/cms/issues/5109

After that was fixed I now get this error, when saving an entry:
image

Element 44 could not be duplicated for site 2: Slug cannot be blank.
Of course I have a slug set, and also normally it should fill a slug in automatically...

Because it is mentioning site2 I guess this has something to do with my multisite setup.
The entry I try to save is in site1 and the error comes with a thing that can't be duplicated for site2.
If I try to save an entry of site2 I get the error the other way around, it can't duplicate for site1.

I further investigated and created a new entry. That worked correctly.
The entries I was trying to save have a neo field inside. As soon as I delete this neo field it can be saved. When I readd it I get this error.

I am not sure if this is a neo thing or not:

craft\errors\InvalidElementException: Element 117 could not be duplicated for site 1: Slug cannot be blank. in /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/services/Elements.php:782
Stack trace:
#0 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/spicyweb/craft-neo/src/services/Fields.php(323): craft\services\Elements->duplicateElement(Object(benf\neo\elements\Block), Array)
#1 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/spicyweb/craft-neo/src/Field.php(662): benf\neo\services\Fields->duplicateBlocks(Object(benf\neo\Field), Object(craft\elements\Entry), Object(craft\elements\Entry), true)
#2 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/base/Element.php(2155): benf\neo\Field->afterElementPropagate(Object(craft\elements\Entry), true)
#3 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/elements/Entry.php(1248): craft\base\Element->afterPropagate(true)
#4 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/services/Elements.php(799): craft\elements\Entry->afterPropagate(true)
#5 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/services/Revisions.php(166): craft\services\Elements->duplicateElement(Object(craft\elements\Entry), Array)
#6 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/elements/Entry.php(1252): craft\services\Revisions->createRevision(Object(craft\elements\Entry), '1', NULL)
#7 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/services/Elements.php(2000): craft\elements\Entry->afterPropagate(false)
#8 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/services/Elements.php(487): craft\services\Elements->_saveElementInternal(Object(craft\elements\Entry), true, true, true)
#9 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/controllers/EntriesController.php(378): craft\services\Elements->saveElement(Object(craft\elements\Entry))
#10 [internal function]: craft\controllers\EntriesController->actionSaveEntry(false)
#11 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#13 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/web/Controller.php(187): yii\base\Controller->runAction('save-entry', Array)
#14 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save-entry', Array)
#15 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/web/Application.php(299): yii\base\Module->runAction('entries/save-en...', Array)
#16 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/web/Application.php(566): craft\web\Application->runAction('entries/save-en...', Array)
#17 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/craftcms/cms/src/web/Application.php(278): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#18 /Users/USER/Documents/github/xxxxx/xxx-repo/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#19 /Users/USER/Documents/github/xxxxx/xxx-repo/web/index.php(22): yii\base\Application->run()
#20 {main}

Also because this Neo thing worked with the multisite setup just until before I had the problems mentioned here: https://github.com/craftcms/cms/issues/5109

If you think this is a neo problem, I will report it there.
Thank you

cheers

Steps to reproduce

  1. Create Multisite setup
  2. Install neo plugin (v2.5.5)
  3. Create section with a neo field
  4. Create a new entry and add a neo block.
  5. Save
  6. Error that the slug can't be duplicated...

Additional info

  • Craft version: 3.4.x-dev
  • PHP version: 7.2
  • Database driver & version: mysql
  • Plugins & versions:
    "craftcms/element-api": "2.5.4",
    "craftcms/redactor": "2.3.3.2",
    "mmikkel/cp-field-inspect": "1.0.6",
    "nystudio107/craft-seomatic": "3.2.28",
    "putyourlightson/craft-cp-style-guide": "1.0.2",
    "sebastianlenz/linkfield": "1.0.19",
    "spicyweb/craft-neo": "^2.5.5",
    "verbb/field-manager": "2.1.0",
    "vlucas/phpdotenv": "^2.4.0"

Most helpful comment

This is a duplicate of #5097, which we fixed in 3.3.11, and just merged that into the 3.4 branch. Run composer update and you should be back in business.

>All comments

This is a duplicate of #5097, which we fixed in 3.3.11, and just merged that into the 3.4 branch. Run composer update and you should be back in business.

Was this page helpful?
0 / 5 - 0 ratings