Pennebaker / craft-architect

A plugin for importing and exporting content models from Craft 3/4 using JSON.
MIT License
72 stars 6 forks source link

Console import of Neo fields results in unknown method getBodyParam() #64

Open paulnzime opened 1 year ago

paulnzime commented 1 year ago

Running the attached JSON via the Architect import area of the CMS works fine but attempting to import this via the CLI command results in the following error:

Calling unknown method: craft\console\Request::getBodyParam()

Digging deeper into this, I can see that this occurs because of line 351 in /vendor/spicyweb/craft-neo/src/Field.php that does this: } elseif ($request->getBodyParam('neoBlockType' . (string)$blockTypeId) !== null) {

And I've confirmed adding !$request->getIsConsoleRequest() resolves the issue.

Is this an Architect issue or should I raise with the developers of Neo instead?

To Reproduce Use the following JSON file: neo-import.json.zip

Environment:

spAnser commented 1 year ago

Hmm. I'm unsure. Does it import properly with that added?

spAnser commented 1 year ago

It may be something I can fix. I'll have to do some testing. I may be able to re-create the bodyParam if run from cli but it could also just be that neo is complicated and maybe cli support isn't worth it for plugins that could change at any time and need constant maintenance.