You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?php
public function registerMediaCollections(): void
{
$this->addMediaCollection('images');
$this->addMediaCollection('thumbnail')
->singleFile();
}
Then uploading some images by
<?php
public function uploadImages(Request $request, $id)
{
$files = $request->allFiles()['images'];
foreach($files as $uploaded_file) {
Modification::find($id)
->addMedia($uploaded_file)
->toMediaCollection('images');
}
And then selecting thumbnail by this (copied image replaces thumbnail for newer)
<?php
public function selectThumbnail($mod_id, $file_id)
{
Media::find($file_id)->copy(Modification::find($mod_id),'thumbnail');
return back();
}
But for some reason copying to another collection works weird. I can copy file with incrementing id's, but can't with decrementing id's.
Example: uploaded 4 files with id=1, id=2, id=3, id=4. Selecting thumbnail with id=1 - ok, selecting id=2 - ok, selecting id=3 - ok, but now i can't choose thumbnail with file id=1 and id=2, only higher than selected id now
Is it only my fault or actually bug?
UPD: Seems like that problem is described here: issue
The text was updated successfully, but these errors were encountered:
drnkwtr
changed the title
Probably copying from MediaCollection to singleFile Collection works weird
Probably copying from MediaCollection to singleFile MediaCollection works weird
May 6, 2024
I registered 2 media collections:
Then uploading some images by
And then selecting thumbnail by this (copied image replaces thumbnail for newer)
But for some reason copying to another collection works weird. I can copy file with incrementing id's, but can't with decrementing id's.
Example: uploaded 4 files with id=1, id=2, id=3, id=4. Selecting thumbnail with id=1 - ok, selecting id=2 - ok, selecting id=3 - ok, but now i can't choose thumbnail with file id=1 and id=2, only higher than selected id now
Is it only my fault or actually bug?
UPD: Seems like that problem is described here: issue
The text was updated successfully, but these errors were encountered: