Media module: Error on insert media
Caching issue this one:
index line 522, kol 16 of path 'backend/media/media-grid/index')
TypeError: window.opener.includeMediaMultiple is not a function
Make sure you have cleared your view
Unfortunately it is not cache, I tried in three different browsers, all cache cleared.
The error says that includeMediMultiple is not a function, it is on a media::admin.fields.new-file-link-single field. Could this be a clue?
Did you clear browser cache?
Just clarifying to clear laravel view cache (php artisan view:clear).
thanks @armababy I was indeed speaking about the laravel cache
Laravel cache is also completely cleared. Removed all cache files in the following folders:
Still get the js error. I'm back on Media Module version 1.25.4
Anyone can replicate this?
I tried on Opera, Firefox, Chrome everything works for me without errors on Media 1.25.4
Can't replicate it neither, only tried with FF and Chrome
I tried on a freshly installed version and the error is gone.
I still hope someone has an idea how the problem could occur since I don't want the same issue again. It is time wasting to have to restart on a fresh install after an update.
Got the same error again after importing my own created modules. In other words I have to find a solution to fix this.
A console.log on window.opener.single = undefined
window.opener does exist
I found out that it is only in the edit form and not on a create form.
I use the following code in the edit form:
@include('media::admin.fields.file-link', [ 'entityClass' => 'Modules\\\\Brand\\\\Entities\\\\Brand', 'entityId' => $brand->id, 'zone' => 'logo' ]) @include('media::admin.fields.file-link', [ 'entityClass' => 'Modules\\\\Brand\\\\Entities\\\\Brand', 'entityId' => $brand->id, 'zone' => 'header' ])
In the controller:
public function edit(Brand $brand)
$header = $brand->getHeaderImage();
$logo = $brand->getLogo();
$pages = $this->getPagesForSelect();
return view('brand::admin.brands.edit', compact('brand', 'header', 'logo', 'pages'));
Did you try using new partials and whole process? Or that is not an option for you?
How do you use old partials on create forms?
At least we can now see problem, new implementation of recent fix needs to be back ported also.
@motchju will you PR new changes to old partial fields or should i do it?
@armababy not sure if I understand you completely.
I'm using the partial from the docs in the edit section.
'entityClass' => 'Modules\\\\Article\\\\Entities\\\\Article',
'entityId' => $article->id,
'zone' => 'coverimage'
The partials on the create page are from the create section:
@include('media::admin.fields.new-file-link-single', [ 'zone' => 'logo' ]) @include('media::admin.fields.new-file-link-single', [ 'zone' => 'header' ])
If you can you should change all partials to new
media::admin.fields.new-file-link-singleones like you have in create view.
Currently we forgot to back port new changes to old partials
If updating to new ones and use events is not for you, we wait for PR.
Documentation on edit view is a bit outdated on new method currently.
Basically you can use new partials in all your views and make 1 or 2 events that implements StoringMedia. You can use 1 event if no differences in code.
Ok, the new partial is also not really the solution, I'm able now to select an image, but it is not stored in the imageables table.
I hope that the back port will be available soon and the documentation will be updated as well.
@StanB Did you fire event on update method?
hmm, probably not.... I will check and fix it soon. I will let you know if it fixed it.
@StanB I'm currently using new partials on all views with 1 event.
Only thing is that it currently does not remove already attached media files, also does not update orders of multiple form.
Issue raised @github#214
it can detach items too as it is explained in the docs.
There is also no need to fire an event on update as that is not used.
I am able to reproduce the error on edit views indeed.
@motchju must have forgotten about those while doing he PR
I've applied changes from @motchju from here to the
file-link-multiplepartials . But in general.blade.php
window.opener.singleis still undefined, I'm not sure where @motchju you set that ?