Hello all,

I have been using this module from Drupal 10.1.7 and I have to say it is amazing. However I found an issue while importing terms using Countries images into a media field. The error I am returned is the following.

TypeError: Exception::__construct(): Argument #2 ($code) must be of type int, array given in Exception->__construct() (line 175 of /var/www/html/un-sdg-d10/web/modules/contrib/countries_import/src/Services/FileUtils.php).

After debugging I see the $dir variable is setted to ":", it implies apache/nginx is trying to create that directory into projects root "./web/:", not into files directory.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pgrandeg created an issue. See original summary.

chetan 11 made their first commit to this issue’s fork.

chetan 11’s picture

Status: Active » Needs review

Please check the above MR.

pgrandeg’s picture

After digging a little bit more, I think the issue is regarding the getFieldConfig() method.
My taxonomy vocabulary has a media file, using 'Image' media bundle. That bundle has some extra fields and as far as I have seen, the getFieldConfig() is choosing the wrong field instead of the File field.

aavand made their first commit to this issue’s fork.

anthelixes’s picture

Status: Needs review » Reviewed & tested by the community

The patch fixed the issue. Thanks everyone. I will merge for the next release.

anthelixes’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.