Support Matrix + Super Table nested importing #889
Replies: 11 comments
-
i was using feedme to import into a super table inside a matrix and it only imported the first row of each supertable in a matrix block. wondering what the best workaround would be until this is working. thanks! |
Beta Was this translation helpful? Give feedback.
-
Is there a solution for this? We wont be able to use super table inside a matrix if we can import into it. At the moment it creates a separate matrix entry with a ingle super table row in each, instead of one matrix entry and multiple super table rows. Thanks |
Beta Was this translation helpful? Give feedback.
-
The problem is because the $parsedValue array only contains one super table row to import. Super Table like Matrix takes arrays like:
But actually only the first or last one is returned, so there is only one new array, not all of them. So I aded this dirty hack to get it working. I just create a new parsedValue array with all the rows like above. This would not be the clean solution needed, but its got it working for me in case anyone else needs a quick solution: Replace this line 113 in vendor/craft/feed-me/src/fields/Matrix.php: With this code
|
Beta Was this translation helpful? Give feedback.
-
@amityweb Your code worked great! I just needed to place |
Beta Was this translation helpful? Give feedback.
-
This fix also worked for me. Thanks a lot @amityweb! Is this a FeedMe bug? Or is there another way to format my JSON to get this to work? I love that it's working now... but I'm not too keen on hacking a plugin like this... |
Beta Was this translation helpful? Give feedback.
-
Not necessarily a bug, I dont think its supported yet. In fact you can see Brandon added the enhancement label, so its on their list to do I hope. Shouldn't take too long now I've highlighted the issue to be honest. More elegant code will probably be used though :) I don't like hacking either but lucky for me its a one off import on site migration from WP to Craft. So now its done I don't need anymore, so I didnt mind hacking it to get it to work. In fact I had to, we had way too much content for me to copy and paste and not use Feedme. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
About to try using the code above for our data import. Would love to see this prioritized into the actual codebase! |
Beta Was this translation helpful? Give feedback.
-
We've hit an edge case and I'm looking for support/help/insight.
apart from this, fields in each block are identical When importing, an image belonging to
We're already resetting |
Beta Was this translation helpful? Give feedback.
-
I want to import content with Super Tables in Matrix fields. I am glad I found this discussion, but even with the suggested hack by @amityweb, it does not work. Is this something that the Craft Team is considering working on? |
Beta Was this translation helpful? Give feedback.
-
Yo why is the issue this discussion came off of marked complete?? It's 2024 and I still had to shove that vendor code in to get it to work! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions