Skip to content

oldId -> id#3

Closed
MikeMcChillin wants to merge 1 commit intobarrelstrength:developfrom
MikeMcChillin:patch-1
Closed

oldId -> id#3
MikeMcChillin wants to merge 1 commit intobarrelstrength:developfrom
MikeMcChillin:patch-1

Conversation

@MikeMcChillin
Copy link

Got this error, changing oldId to id seemed to fix.

'invalid-model-match' => [
        0 => 'Setting unknown property: craft\\elements\\db\\EntryQuery::oldId'
    ]

Got this error, changing `oldId` to `id` seemed to fix.
```
'invalid-model-match' => [
        0 => 'Setting unknown property: craft\\elements\\db\\EntryQuery::oldId'
    ]
```
@BenParizek
Copy link
Member

Thanks for the suggestion @MikeMcChillin

The use of oldId is intentional here. I'm going to add a note to the docs to clarify why.

In these examples oldId is a custom field that represents an ID that you imported from another system. Often, when importing data from another system a storing a temporary legacy ID in a custom field can help match and relate other data that you are importing in separate steps.

You can use id, slug, or any other property or custom field to match an existing element that are updating.

As you found, id and other values work as well. That updateElement key essentially lets you query for any entry you wish to match in the same way that you would do in when building a craft.entries.all()query.

@BenParizek BenParizek closed this Jul 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants