I get the following error when I add a file field to the mapping:

Notice: Array to string conversion in /docroot/modules/contrib/feeds_para_mapper/src/Feeds/Target/WrapperTarget.php on line 297

The field properties cannot be edited and the import crashes when ran.

Comments

mfv created an issue. See original summary.

mfv’s picture

Also when running the import I get the following error:

Notice: Undefined variable: field in /docroot/modules/contrib/feeds_para_mapper/src/Importer.php on line 730

demonde’s picture

I get two errors, maybe related

Notice: Array to string conversion in Drupal\feeds_para_mapper\Feeds\Target\WrapperTarget->getSummary() (line 283 of /modules/feeds_para_mapper/src/Feeds/Target/WrapperTarget.php)

and

LogicException: The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution. in Drupal\Core\Database\Connection->__sleep() (line 1546 of /core/lib/Drupal/Core/Database/Connection.php)

The import fails using Drupal 8.8.x

danharper’s picture

Im getting the same issue, nothing will save in the mapping UI.

So currently this module doesn't work with anything great than 8.8.x.

I'm not sure how people are importing paragraphs without this module apart from creating separate feeds.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new1.58 KB

I haven't tested it yet (the field mapper doesn't respond after installing this module), but does this help?

joseph.olstad’s picture

Status: Needs review » Fixed
joseph.olstad’s picture

joseph.olstad’s picture

Status: Fixed » Needs review

Needs review

ivanhelguera’s picture

When applying the patch to 8-1.x branch, i get this code:

      if (isset($sum) && $sum instanceof TranslatableMarkup) {
        $final_str = $sum->getUntranslatedString();
        $final_str .= "<br>" . $temp_sum;
        $args = $sum->getArguments();
        if (isset($args)) {
          $final_str[] = $this->t($final_str, $args);
        }

$final_str .= "<br>" . $temp_sum;
makes it a string, and then
$final_str[] = $this->t($final_str, $args);
treats it as an array? That gives an `[] operator not supported` error.

ivanhelguera’s picture

StatusFileSize
new602 bytes

A simpler solution perhaps is to convert $sum to string if it's an array when it's being created.

 $sum = is_array($sum) ? implode(PHP_EOL, $sum) : $sum;

  • joseph.olstad committed acf6c8ae on 8.x-1.x
    [#3134976] feat: Notice: Array to string conversion in /docroot/modules/...
joseph.olstad’s picture

Status: Needs review » Fixed

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

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

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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