Account created on 6 June 2016, over 8 years ago
#

Recent comments

It always imports only 1 paragraph into the same parent field

Scenario is:

Content type : Page
Field: Content (has multiple paragraph references including text, related content, documents)
it only imports the first reference. if if I first map text target it only imports that and ignore the next one which is related content
If I map related content first it will import that and ignores the text
if I call explode() in the beginning of the import() function it will only import the last target

It always imports only 1 paragraph into the same parent field

Scenario is:

Content type : Page
Field: Content (has multiple paragraph references including text, related content, documents)
it only imports the first reference. if if I first map text target it only imports that and ignore the next one which is related content
If I map related content first it will import that and ignores the text
if I call explode() in the beginning of the import() function it will only import the last target

Any update on this?

It always imports only 1 paragraph into the same parent field

Scenario is:

Content type : Page
Field: Content (has multiple paragraph references including text, related content, documents)
it only imports the first reference. if if I first map text target it only imports that and ignore the next one which is related content
If I map related content first it will import that and ignores the text
if I call explode() in the beginning of the import() function it will only import the last target

It always imports only 1 paragraph into the same parent field

Scenario is:

Content type : Page
Field: Content (has multiple paragraph references including text, related content, documents)
it only imports the first reference. if if I first map text target it only imports that and ignore the next one which is related content
If I map related content first it will import that and ignores the text
if I call explode() in the beginning of the import() function it will only import the last target

It always imports only 1 paragraph into the same parent field

Scenario is:

Content type : Page
Field: Content (has multiple paragraph references including text, related content, documents)
it only imports the first reference. if if I first map text target it only imports that and ignore the next one which is related content
If I map related content first it will import that and ignores the text
if I call explode() in the beginning of the import() function it will only import the last target

Is there any update on this please?
I really need to import more than 1 paragraph on a same parent field. But it always imports only 1

now I am trying to create the paragraph:

private function setValue($paragraph, $value) {
$target = $this->target->getName();

// Check if the paragraph is null
if ($paragraph === null) {
// Prepare host info
$host_info = [];
$entity = $this->entity; // Use the current entity as the parent
$host_info['bundle'] = 'paragraph'; // Use the method to get the bundle
$host_info['field'] = $target; // Use the target as the field
$host_info['entity'] = $entity;

// Call createParagraph to create a new paragraph
$paragraph = $this->createParagraph($host_info['field'], $host_info['bundle'], $host_info['entity']);
\Drupal::logger('feed_para_mapper')->info('Paragraph type: @type', ['@type' => $paragraph->getType()]);
} else {
// Reset the values of the target if paragraph already exists
$paragraph->{$target} = NULL;
\Drupal::logger('feed_para_mapper')->info('Paragraph type: @type', ['@type' => $paragraph->getType()]);
}

// Set the target and prepare values
$this->instance->setTarget($this->feed, $paragraph, $target, $value);
}

I did some changes to debug the function:

private function setValue($paragraph, $value) {
$target = $this->target->getName();

// Check if paragraph is null
if ($paragraph === null) {
\Drupal::logger('feed_para_mapper')->error("Paragraph is null.");
return; // or handle the error
}

// Check if paragraph is an instance of EntityInterface
if (!$paragraph instanceof \Drupal\Core\Entity\EntityInterface) {
\Drupal::logger('feed_para_mapper')->error("Invalid paragraph entity.");
return; // or handle the error
}

// Check if target property exists
if (property_exists($paragraph, $target)) {
$paragraph->{$target} = NULL;
// Log the current value
\Drupal::logger('feed_para_mapper')->info("Current value: @value", ['@value' => print_r($paragraph->{$target}, true)]);
} else {
// Handle case where the target property does not exist
\Drupal::logger('feed_para_mapper')->warning("Target property does not exist: @target", ['@target' => $target]);
}

// Set the target value
$this->instance->setTarget($this->feed, $paragraph, $target, $value);
}

so now it will import the ONLY the first referenced paragraph ...
but still the issue exist if you want to map more than 1 referenced paragraph

there is an option to group the exposed filter and then use contains "suburb name" as the name and value:



Hi
I have this issue in the latest version provided for Drupal 10
Is there any patch for this? I'll be thankful if anyone can help

Production build 0.71.5 2024