feed-me icon indicating copy to clipboard operation
feed-me copied to clipboard

Issue with matrix blocks containing table flieds

Open McCrisp opened this issue 6 years ago • 1 comments

I'm running into a problem when I am trying to import a set of matrix blocks all containing a table with multiple rows. It seems to find all the data, but only import one row per table.

Groups -> Group is a matrix block, and Ingredients -> Ingredient is a row in the table field. As you can see from the screenshots only the frist element in ingredients is imported.

<?xml version="1.0" encoding="UTF-8" ?>
<recipies>
    <recipie>
        <status>live</status>
        <created>2018-10-04</created>
        <title>Karamellpudding med bær, krem og ristede nøtter</title>
        <image>https://wwwsomeimageurl.com/168312_181004_104141.jpg</image>
        <dish>Dessert</dish>
        <time />
        <portions>1</portions>
        <concept />
        <groups>
            <group>
                <title>Sauce</title>
                <ingredients>
                    <ingredient>
                        <title>Sukker</title>
                        <amount>1.00</amount>
                        <unit>dl</unit>
                    </ingredient>
                    <ingredient>
                        <title>Melk</title>
                        <amount>6.00</amount>
                        <unit>dl</unit>
                    </ingredient>
                </ingredients>
            </group>
            <group>
                <title>Sukkersaltede nøtter og frø</title>
                <ingredients>
                    <ingredient>
                        <title>Sesamfrø</title>
                        <amount>1.00</amount>
                        <unit>ss</unit>
                    </ingredient>
                    <ingredient>
                        <title>Gresskarkjerner</title>
                        <amount>3.00</amount>
                        <unit>ss</unit>
                    </ingredient>
                </ingredients>
            </group>
        </groups>
    </recipie>
</recipies>

I have tried structuring the XML a bit different without the groups or ingredients parent element, but nothing seems to work:

<?xml version="1.0" encoding="UTF-8"?>
<recipies>
   <recipie>
      <status>live</status>
      <created>2018-10-04</created>
      <title>Karamellpudding med bær, krem og ristede nøtter</title>
      <image>https://wwwsomeimageurl.com/168312_181004_104141.jpg</image>
      <dish>Dessert</dish>
      <time />
      <portions>1</portions>
      <concept />
      <group>
         <title>Sauce</title>
         <ingredient>
            <title>Sukker</title>
            <amount>1.00</amount>
            <unit>dl</unit>
         </ingredient>
         <ingredient>
            <title>Melk</title>
            <amount>6.00</amount>
            <unit>dl</unit>
         </ingredient>
      </group>
      <group>
         <title>Sukkersaltede nøtter og frø</title>
         <ingredient>
            <title>Sesamfrø</title>
            <amount>1.00</amount>
            <unit>ss</unit>
         </ingredient>
         <ingredient>
            <title>Gresskarkjerner</title>
            <amount>3.00</amount>
            <unit>ss</unit>
         </ingredient>
      </group>
   </recipie>
</recipies>

Matrix field: Screenshot 2019-05-13 at 13 50 15

FeedMe: Screenshot 2019-05-13 at 13 53 41

FeedMe Pro version: 4.1.0 Craft CMS 3.1.26

McCrisp avatar May 15 '19 09:05 McCrisp

Wondering if you managed to find a solution for this. Currently also a blocker I'm struggling with.

ghost avatar May 20 '20 12:05 ghost

I’ve reviewed and tested the structure, and it’s incorrect. You can follow this structure.

<recipies>
    <recipie>
        <status>live</status>
        <created>2018-10-04</created>
        <title>Karamellpudding med bær, krem og ristede nøtter</title>
        <image>https://wwwsomeimageurl.com/168312_181004_104141.jpg</image>
        <dish>Dessert</dish>
        <time/>
        <portions>1</portions>
        <concept/>
        <groups>
            <title>Sauce</title>
            <ingredients>
                <ingredient>
                    <title>Sukker</title>
                    <amount>1.00</amount>
                    <unit>dl</unit>
                </ingredient>
                <ingredient>
                    <title>Melk</title>
                    <amount>6.00</amount>
                    <unit>dl</unit>
                </ingredient>
            </ingredients>
        </groups>
        <groups>
            <title>Sukkersaltede nøtter og frø</title>
            <ingredients>
                <ingredient>
                    <title>Sesamfrø</title>
                    <amount>1.00</amount>
                    <unit>ss</unit>
                </ingredient>
                <ingredient>
                    <title>Gresskarkjerner</title>
                    <amount>3.00</amount>
                    <unit>ss</unit>
                </ingredient>
            </ingredients>
        </groups>
    </recipie>
</recipies>

pdaleramirez avatar Apr 19 '23 04:04 pdaleramirez