简体   繁体   中英

Error trying to load fixtures during Sylius Installation

I'm trying to use the web installer to load fixtures into my Sylius installation. It works fine if I don't check the load fixtures box but if it is checked, I get to this page:

http://localhost/app_dev.php/installer/flow/sylius_installer/setup/forward

and get an error. I have tried it with 2 different versions of fzaninotto/faker

With "fzaninotto/faker": "1.1.*", in composer.json, I get:

Unknown formatter "randomFloat"

With "fzaninotto/faker": "dev-master", in composer.json, I get:

Warning: array_keys() expects parameter 1 to be array, object given in {webroot}\vendor\fzaninotto\faker\src\Faker\Provider\Base.php line 127

I have also tried running the installer in command prompt but I get a different error:

php app/console sylius:install --fixtures

[RuntimeException]
The "--fixtures" option does not exist.

I probably have that command wrong but that is how I have seen it in a couple of places.

Any suggestions would be appreciated.

You can run:

php app/console sylius:install

Installer will kindly ask you if you want to load fixtures.

Regarding error, did you installed vendors or updates? It may be that new version of faker have BC break.

This little array cast fixed things for me, as I think it's passing in an ArrayObject or "ArrayCollection"

$keys = array_keys((array)$array);

Maybe not the right solution but ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM