I'm trying to import entries with an Asset inside a subfolder. Since I don't know what the new Craft subfolder ID will be for each Asset I tried to use the folderPath
property from Craft's Asset element class:
[
{
"@model": "barrelstrength\\sproutimport\\importers\\elements\\Entry",
"attributes": {
"sectionId": 2,
"typeId": 2,
"authorId": 1,
"slug": "my-sample-document",
"postDate": "2017-11-09 13:06:00",
"expiryDate": null,
"enabled": true
},
"content": {
"title": "My Sample Document",
"fields": {
"description": "<p>Nulla sit amet est. In hac habitasse platea dictumst. Pellentesque ut neque.</p>"
},
"related": {
"documentFile": {
"@model": "barrelstrength\\sproutimport\\importers\\elements\\Asset",
"params": {
"filename": ["my-sample-document.pdf"],
"volumeId": 9,
"folderPath": "documents/pdfs/"
}
}
}
}
}
]
However the import fails with this error:
[error][sprout-import] Setting unknown property: craft\elements\db\AssetQuery::folderPath
I don't get an error when I use the folderId
property. Can I only use properties that correspond with database columns? Is there any way to do this if I don't know the subfolder ID for every asset I'm importing?
- Craft 3.0.26.1
- Sprout Import 1.0.0-beta.14