spicywebau / craft-neo

A Matrix-like field type for Craft CMS that uses existing fields
Other
402 stars 63 forks source link

[Craft 5] FeedMe import: Calling unknown method: craft\services\Fields::getFieldIdsByLayoutIds() #904

Closed lucasdaniels closed 3 months ago

lucasdaniels commented 3 months ago

Bug Description

When trying to run a FeedMe import, the import fails on Calling unknown method: craft\services\Fields::getFieldIdsByLayoutIds()

In the FeedMe Debug is seems to originate in craft-neo/src/integrations/feedme/Field.php at line 277– benf\neo\Field::getBlockTypeFields() $subField = Hash::extract($this->field->getBlockTypeFields(), '{n}[handle=' . $subFieldHandle . ']')[0];

This is a Craft 4 project upgraded to Craft 5

I am trying to import data from one site to another, directly into NEO blocks. I have been able to do this successfully last year (Craft 4 + Neo 4.0), but when using these .json files now, they also throw up the same error. So I am not entirely sure this is down to the JSON set up - but that is still a possibility of course.

This is a test json file(link removed after fix) (and validates):

I have created a new simpler Neo field to test : Text (CKeditor field) Quote (CKeditor + plain text field) Image (Assets + plain text field)

Stacktrace: `yii\base\UnknownMethodException: Calling unknown method: craft\services\Fields::getFieldIdsByLayoutIds() in /var/www/html/vendor/yiisoft/yii2/base/Component.php:308 Stack trace:

0 /var/www/html/vendor/spicyweb/craft-neo/src/Field.php(277): yii\base\Component->__call('getFieldIdsByLa...', Array)

1 /var/www/html/vendor/spicyweb/craft-neo/src/integrations/feedme/Field.php(277): benf\neo\Field->getBlockTypeFields()

2 /var/www/html/vendor/spicyweb/craft-neo/src/integrations/feedme/Field.php(156): benf\neo\integrations\feedme\Field->_parseSubField(Array, 'vizySingleImage', Array)

3 /var/www/html/vendor/craftcms/feed-me/src/services/Fields.php(234): benf\neo\integrations\feedme\Field->parseField()

4 /var/www/html/vendor/craftcms/feed-me/src/services/Process.php(405): craft\feedme\services\Fields->parseField(Array, Object(craft\elements\Entry), Array, 'bodyTextNeoHand...', Array)

5 /var/www/html/vendor/craftcms/feed-me/src/services/Process.php(624): craft\feedme\services\Process->processFeed(0, Array, Array)

6 /var/www/html/vendor/craftcms/feed-me/src/controllers/FeedsController.php(296): craft\feedme\services\Process->debugFeed(Object(craft\feedme\models\FeedModel), NULL, NULL, Array)

7 [internal function]: craft\feedme\controllers\FeedsController->actionDebug()

8 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)

9 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)

10 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('debug', Array)

11 /var/www/html/vendor/craftcms/cms/src/web/Application.php(349): yii\base\Module->runAction('feed-me/feeds/d...', Array)

12 /var/www/html/vendor/craftcms/cms/src/web/Application.php(650): craft\web\Application->runAction('feed-me/feeds/d...', Array)

13 /var/www/html/vendor/craftcms/cms/src/web/Application.php(311): craft\web\Application->_processActionRequest(Object(craft\web\Request))

14 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))

15 /var/www/html/web/index.php(12): yii\base\Application->run()

16 {main}`

FeedMe 6.1.0

Steps to reproduce

  1. Create FeedMe import (create, create & update)
  2. using the attached(link removed after fix) JSON
  3. Map to the correct Neo Fields
  4. Debug feedme throws error, creates no new entries.

Expected behaviour

No response

Neo version

5.0.4

Craft CMS version

5.2.4.1

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

ttempleton commented 3 months ago

Thanks for reporting that - fixed for the next release.

ttempleton commented 3 months ago

Just released 5.0.5 including that fix.