Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Craft 5] Asset Location setting has an invalid subpath with Matrix/Neo fields #1477

Closed
lucasdaniels opened this issue Jul 8, 2024 · 3 comments
Assignees
Labels

Comments

@lucasdaniels
Copy link

lucasdaniels commented Jul 8, 2024

Description

When trying to import an asset in to an image field through FeedMe to a Matrix (or Neo) field it throws an error: Asset Location setting has an invalid subpath handbooks/{owner.slug}. This was initially a Neo field, which throws the same error, but I have converted this using the built-in Neo to Matrix converter in to a Matrix field.

When manually creating an entry and adding an asset to the Matrix (or Neo) it works and the image is saved in the correct location.

Good thing to note is that the assets are hosted via Servd Asset - the machine is local (DDEV), but assets are saved on their asset platform. The "Send Feed Me logs to Craft's standard log output so that they can be collected and displayed by Servd." option is checked in the settings of the Servd Assets and Helpers plugin.

Stracktrace:
craft\errors\InvalidSubpathException: Could not resolve the subpath “handbooks/{owner.slug}”. in /var/www/html/vendor/craftcms/cms/src/fields/Assets.php:908 Stack trace: #0 /var/www/html/vendor/craftcms/cms/src/fields/Assets.php(1005): craft\fields\Assets->_findFolder('volume:446f5a99...', 'handbooks/{owne...', Object(craft\elements\Entry), true) #1 /var/www/html/vendor/craftcms/cms/src/fields/Assets.php(453): craft\fields\Assets->_uploadFolder(Object(craft\elements\Entry)) #2 /var/www/html/vendor/craftcms/feed-me/src/fields/Assets.php(94): craft\fields\Assets->resolveDynamicPathToFolderId(Object(craft\elements\Entry)) #3 /var/www/html/vendor/spicyweb/craft-neo/src/integrations/feedme/Field.php(288): craft\feedme\fields\Assets->parseField() #4 /var/www/html/vendor/spicyweb/craft-neo/src/integrations/feedme/Field.php(156): benf\neo\integrations\feedme\Field->_parseSubField(Array, 'handbookSingleI...', Array) #5 /var/www/html/vendor/craftcms/feed-me/src/services/Fields.php(234): benf\neo\integrations\feedme\Field->parseField() #6 /var/www/html/vendor/craftcms/feed-me/src/services/Process.php(405): craft\feedme\services\Fields->parseField(Array, Object(craft\elements\Entry), Array, 'bodyTextNeoHand...', Array) #7 /var/www/html/vendor/craftcms/feed-me/src/services/Process.php(624): craft\feedme\services\Process->processFeed(0, Array, Array) #8 /var/www/html/vendor/craftcms/feed-me/src/controllers/FeedsController.php(296): craft\feedme\services\Process->debugFeed(Object(craft\feedme\models\FeedModel), NULL, NULL, Array) #9 [internal function]: craft\feedme\controllers\FeedsController->actionDebug() #10 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array) #11 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array) #12 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('debug', Array) #13 /var/www/html/vendor/craftcms/cms/src/web/Application.php(349): yii\base\Module->runAction('feed-me/feeds/d...', Array) #14 /var/www/html/vendor/craftcms/cms/src/web/Application.php(650): craft\web\Application->runAction('feed-me/feeds/d...', Array) #15 /var/www/html/vendor/craftcms/cms/src/web/Application.php(311): craft\web\Application->_processActionRequest(Object(craft\web\Request)) #16 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request)) #17 /var/www/html/web/index.php(12): yii\base\Application->run() #18 {main} Next craft\errors\InvalidSubpathException: The Handbook Single Image field’s Asset Location setting has an invalid subpath (“handbooks/{owner.slug}”). in /var/www/html/vendor/craftcms/cms/src/fields/Assets.php:1025 Stack trace: #0 /var/www/html/vendor/craftcms/cms/src/fields/Assets.php(453): craft\fields\Assets->_uploadFolder(Object(craft\elements\Entry)) #1 /var/www/html/vendor/craftcms/feed-me/src/fields/Assets.php(94): craft\fields\Assets->resolveDynamicPathToFolderId(Object(craft\elements\Entry)) #2 /var/www/html/vendor/spicyweb/craft-neo/src/integrations/feedme/Field.php(288): craft\feedme\fields\Assets->parseField() #3 /var/www/html/vendor/spicyweb/craft-neo/src/integrations/feedme/Field.php(156): benf\neo\integrations\feedme\Field->_parseSubField(Array, 'handbookSingleI...', Array) #4 /var/www/html/vendor/craftcms/feed-me/src/services/Fields.php(234): benf\neo\integrations\feedme\Field->parseField() #5 /var/www/html/vendor/craftcms/feed-me/src/services/Process.php(405): craft\feedme\services\Fields->parseField(Array, Object(craft\elements\Entry), Array, 'bodyTextNeoHand...', Array) #6 /var/www/html/vendor/craftcms/feed-me/src/services/Process.php(624): craft\feedme\services\Process->processFeed(0, Array, Array) #7 /var/www/html/vendor/craftcms/feed-me/src/controllers/FeedsController.php(296): craft\feedme\services\Process->debugFeed(Object(craft\feedme\models\FeedModel), NULL, NULL, Array) #8 [internal function]: craft\feedme\controllers\FeedsController->actionDebug() #9 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array) #10 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array) #11 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('debug', Array) #12 /var/www/html/vendor/craftcms/cms/src/web/Application.php(349): yii\base\Module->runAction('feed-me/feeds/d...', Array) #13 /var/www/html/vendor/craftcms/cms/src/web/Application.php(650): craft\web\Application->runAction('feed-me/feeds/d...', Array) #14 /var/www/html/vendor/craftcms/cms/src/web/Application.php(311): craft\web\Application->_processActionRequest(Object(craft\web\Request)) #15 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request)) #16 /var/www/html/web/index.php(12): yii\base\Application->run() #17 {main}

Steps to reproduce

  1. Create a Matrix (or neo, tried both) field, with a dynamic subpath (e.g. handbooks/{owner.slug})
  2. Create FeedMe feed, with create asset from URL checked (settings)
  3. Debug/Import throws above error.

Additional info

  • Craft version: 5.2.5
  • PHP version: 8.2.15 (ddev)
  • Database driver & version: MySQL 8.0.33
  • Plugins & versions: FeedMe 6.1.0, Servd Assets and Helpers 4.0.3
@lucasdaniels
Copy link
Author

The issue unfortunately also persists in FeedMe 6.2.0.

@i-just
Copy link
Contributor

i-just commented Aug 30, 2024

Hi, thanks for reporting! I was able to replicate this and raised a PR for it.

@angrybrad
Copy link
Member

Resolved in #1501 and will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants