How to structure data using feed-me + JSON + Hyper?
DavidStrada opened this issue · 5 comments
DavidStrada commented
Question
Using the following throws an error:
"websiteUrl": {
"type":"verbb\\hyper\\links\\Url",
"handle": "default-verbb-hyper-links-url",
"linkValue": "www.google.com",
"linkText": "some text"
},
Additional context
I get the following error.
Too few arguments to function craft\feedme\helpers\DataHelper::fetchValue(), 2 passed in /vendor/verbb/hyper/src/integrations/feedme/fields/Hyper.php on line 47 and exactly 3 expected - DataHelper.php: 122
engram-design commented
Can you let me know what versions of everything you're using? The below should be all you require. Note the type
is (for the moment) a shortened string, and not the full class:
"websiteUrl": {
"type":"url",
"linkValue": "www.google.com",
"linkText": "some text"
}
DavidStrada commented
@engram-design sure, here's current setup
"craftcms/cms": "^4.4.7",
"craftcms/feed-me": "5.1.1",
"verbb/hyper": "^1.1",
Tested your example and it fails with the same message
Too few arguments to function craft\feedme\helpers\DataHelper::fetchValue(), 2 passed in /vendor/verbb/hyper/src/integrations/feedme/fields/Hyper.php on line 47 and exactly 3 expected - DataHelper.php: 122
thanks for your help.
DavidStrada commented
@engram-design in here if we pass the obj. it stops failing $preppedData[$subFieldHandle] = DataHelper::fetchValue($this->feedData, $subFieldInfo, $this->feed);
it works.
engram-design commented
This is because you're on an older version of Feed Me. Refer to this fix. I'd recommend updating Feed Me, but happy to make that change here.
engram-design commented
Fixed in 1.1.7