craftcms / feed-me

Craft CMS plugin for importing entry data from XML, RSS or ATOM feeds—routine task or on-demand.
Other
287 stars 139 forks source link

"Unable to match an existing element." when updating against a slug #1515

Open jimmerk opened 1 week ago

jimmerk commented 1 week ago

Description

Using Craft 5.4.4 and FeedMe 6.3.0, MySQL 8

I have about 80 existing articles that I'm trying to update with title tags and meta descriptions from an xml file. I tried this with a cvs file first and got the "unable to match" error. So I "summoned" an xml schema and exported the data as xml. Still getting the same error. I'm sure the slugs exist and should match. I've tried selected the root from three different levels in the hierarchy (including one that lists the record count). I also tried to match on the Title. Same issue.

The xml schema and a sample record...

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="posts">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="post" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="BlogName" type="xs:string"/>
              <xs:element name="PostTitle" type="xs:string"/>
              <xs:element name="PostSEOTitle" type="xs:string"/>
              <xs:element name="PostLanguage" type="xs:string"/>
              <xs:element name="Slug" type="xs:string"/>
              <xs:element name="Author" type="xs:string"/>
              <xs:element name="Tags" type="xs:string"/>
              <xs:element name="MetaDescription" type="xs:string"/>
              <xs:element name="PublishDate" type="xs:date"/>
              <xs:element name="LastModifiedDate" type="xs:date"/>
              <xs:element name="PostBody" type="xs:string"/>
              <xs:element name="FeaturedImageURL" type="xs:string"/>
              <xs:element name="HeadHTML" type="xs:string"/>
              <xs:element name="Status" type="xs:string"/>
              <xs:element name="Archived" type="xs:boolean"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<posts>
    <post>
        <BlogName>stuff</BlogName>
        <PostTitle>stuff</PostTitle>
        <PostSEOTitle>stuff</PostSEOTitle>
        <PostLanguage>stuff</PostLanguage>
        <Slug>stuff</Slug>
        <Author>stuff</Author>
        <Tags>stuff</Tags>
        <MetaDescription>stuff</MetaDescription>
        <PublishDate>stuff</PublishDate>
        <LastModifiedDate>stuff</LastModifiedDate>
        <PostBody>stuff</FeaturedImageURL>
        <HeadHTML/>
        <Status>stuff</Status>
        <Archived>stuff</Archived>
    </post>
</posts>
</xml>

Steps to reproduce

  1. Run the update feed while trying to match on a slug

Results in errors like this... Unable to match an existing element. Have you set a unique identifier for ["slug"]? Make sure you are also mapping this in your feed and it has a value. - Element.php: 178.

Any help would be greatly appreciated! Thanks.

jimmerk commented 3 days ago

Still having trouble with this after the recent update.