Segmentation fault (core dumped) when trying to link 2 products

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
MaHo
Posts: 7
Joined: 24 Sep 2024, 08:03

Segmentation fault (core dumped) when trying to link 2 products

Post by MaHo » 10 Mar 2026, 12:53

I am trying to link 2 products together so product 1 is a suggestion or variant for product 2 and visa versa. when i try to do this i get the error "Segmentation fault (core dumped)"

This is the current code i use to achieve this:

Code: Select all

<?php

$relationIdentifier = "suggestion";

// creating the list item to add the variant to the product
$productListItem = $this->productManager->createListItem()
  ->setRefId($variantItem->getId())
   ->setType($relationIdentifier);           // List type for variants
   
$productItem->addListItem('product', $productListItem, $variantItem);


// creating the list item to add the prodcut to the variant
$variantListItem = $this->productManager->createListItem()
   ->setRefId($productItem->getId())
   ->setType($relationIdentifier);           // List type for variants

$variantItem->addListItem('product', $variantListItem, $productItem);


$this->indexManager->save($productItem);
$this->indexManager->save($variantItem);
The error seems to be thrown when creating the $variantListItem.

How can i get the result i want without crashing? I have tried reordering the code in any logical way but it always throws at creating the second list item.

PHP: 8.3.0
Aimeos: 2025.10.1
Laravel: 11.46.1
Enviroment is Docker on Ubuntu