Skip to content

Formie FileUpload missing resolveDynamicPathToFolderId() causes Feed Me import fatal error (Craft 5) #2671

@Amit3151

Description

@Amit3151

Describe the bug

Description

When importing content with Feed Me into a Formie File Upload field, the import fails with a fatal error because verbb\formie\fields\FileUpload does not implement resolveDynamicPathToFolderId().

Feed Me treats Formie FileUpload as an asset-like field and calls this method (which exists on Craft’s native Assets field), causing a runtime exception.


Steps to Reproduce

  1. Craft CMS 5.x
  2. Formie 3.1.6
  3. Feed Me ^6.0.0
  4. Create a Formie form with a File Upload field
  5. Attempt to import data into this field using Feed Me
  6. Import fails immediately

Actual Behavior

Fatal error during import:

Calling unknown method:
verbb\formie\fields\FileUpload::resolveDynamicPathToFolderId()

Stack trace points to Feed Me’s Assets field importer.


Expected Behavior

Formie FileUpload should be compatible with Feed Me asset imports and not cause fatal errors.


Root Cause

Craft’s native craft\fields\Assets field defines:

public function resolveDynamicPathToFolderId(?ElementInterface $element = null): int
{
    return $this->_uploadFolder($element)->id;
}

Suggested Fix

Add the following method to verbb\formie\fields\FileUpload:

use craft\base\ElementInterface;

public function resolveDynamicPathToFolderId(?ElementInterface $element = null): int
{
    return $this->_uploadFolder($element)->id;
}

Craft CMS version

5.8.11

Plugin version

3.1.6

Multi-site?

No response

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions