Closed martynaskre closed 1 year ago
It's indeed related. It's fixed in the latest release.
More info here: https://github.com/spatie/laravel-medialibrary/issues/3224#issuecomment-1488528110
@martynaskre curious: how many media are being loaded?
I'm curious if the segfault is caused by having a massive number of media for a model or something else.
@freekmurze thoughts on adding a static property to the InteractsWithMedia trait like:
public static bool $setRelationForModels = false;
public function loadMedia(...)
{
if (static::$setRelationForModels)
{
$collection->each->setRelation('model', $this);
}
}
I know that laravel core does this frequently, and then will do something like:
public static function withoutSettingRelation(callable $fn) {
$before = static::$setRelationForModels;
static::$setRelationForModels = false;
$fn();
static::$setRelationForModels = $before;
}
After updating composer packages and installing version
10.7.14
, media library causesSIGSEGV - core dumped
error.Copy from
php8.1-error.log
:It is worth mentioning that this error only occurs in specific circumstances. We are using Livewire Powergrid package for building datatables. This code snippet below adds column to datatable and causes a segmentation fault:
If we modify this function like shown below, then we dont get any errors and standard
dd()
output is displayed with correct media url.I think it might be related to #3219