studioespresso / craft3-seeder

Seeder is the easiest way to quickly create placeholder content while you're building out a website. Create your sections & fields and then let Seeder make entries for you.
https://plugins.craftcms.com/seeder
MIT License
28 stars 3 forks source link

PHP Warning 'yii\base\ErrorException' with message 'array_rand(): Array is empty' #11

Closed belkin closed 4 years ago

belkin commented 5 years ago

I'm getting the following error on some sections (which is strange) but I can't understand on which field (if it's field) can't go further.


in vendor/studioespresso/craft-seeder/src/services/fields/Fields.php:119

Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'array_rand(): A...', '/Users/belkinfa...', 119, Array)
#1 vendor/studioespresso/craft-seeder/src/services/fields/Fields.php(119): array_rand(Array)
#2 vendor/studioespresso/craft-seeder/src/services/SeederService.php(50): studioespresso\seeder\services\fields\Fields->Categories(Object(craft\fields\Categories), Object(craft\elements\Entry))
#3 vendor/studioespresso/craft-seeder/src/services/Entries.php(81): studioespresso\seeder\services\SeederService->populateFields(Array, Object(craft\elements\Entry))
#4 vendor/studioespresso/craft-seeder/src/console/controllers/GenerateController.php(80): studioespresso\seeder\services\Entries->generate(Object(craft\models\Section), 12)
#5 [internal function]: studioespresso\seeder\console\controllers\GenerateController->actionEntries()
#6 vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#7 vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#8 vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('entries', Array)
#9 vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('entries', Array)
#10 vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('seeder/generate...', Array)
#11 vendor/craftcms/cms/src/console/Application.php(93): yii\console\Application->runAction('seeder/generate...', Array)
#12 /vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('seeder/generate...', Array)
#13 /vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#14 craft(22): yii\base\Application->run()
#15 {main}

PHP version: 7.1.22 (tried with 7.2.10 same situation) Craft version: 3.1.19 Seeder version: 3.0.1 Fields: SuperTable fields, Redactor, Date, Plain text, Category, Matrix, Entries (some of them are located under different tabs)

janhenckens commented 5 years ago

Is it possible to share your database/composer @ReXTaN? Had this reported before but couldn't reproduce it at the time. (jan@studioespresso.co or through the Craft CMS Discord)

belkin commented 5 years ago

@janhenckens Sorry but I'm not able to send database/composer files. :/ But maybe I can make somekind of logs or check details over de fields?

janhenckens commented 5 years ago

@ReXTaN That's ok. Field details would be good too, then I'll try to rebuild the your field in my test install and see if I can reproduce it that way.

jan-dh commented 4 years ago

Still getting this error on the latest version, php7.3

janhenckens commented 4 years ago

Haven't gotten around to releasing this, I'll try to this week!

janhenckens commented 4 years ago

Update is out! Can you try again @jan-dh @ReXTaN? Thanks!