User tests: Successful: Unsuccessful:
When creating a 3rd party filesystem plugin and selecting an image in a media file selection (e.g. in the article form view), the image will not be displayed, because the variable is wrong.
@dgrammatiko perhaps you can check?
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript Repository NPM Change |
Is
thump_path
always the same as theurl
? If so then remove it in the Media manager Api, but I think that thump is for a thumbnail provided by some cloud storage providers (s3, dropbox)
No, but that is not the fix here. Thumbpath is for non local adapters. This fix is the call, when someone either insert an image into the editor (via the image plugin) or uses the image media field (like the intro image). In this case only the "url" is relevant. I search the whole Joomla for Joomla.selectedMediaFile.thumb
which is never used, I assume, that is is a leftover or a typo?
So the value filled in has to be Joomla.selectedMediaFile.url
to functional.
So the value filled in has to be Joomla.selectedMediaFile.url to functional.
Yes, you're right. FWIW the thumb part shouldn't be there but rather in
joomla-cms/build/media_source/system/js/fields/joomla-field-media.w-c.es6.js
Lines 159 to 187 in acb3b6d
updatePreview() {
if (['true', 'static'].indexOf(this.preview) === -1 || this.preview === 'false' || !this.previewElement) {
return;
}
// Reset preview
if (this.preview) {
const { value } = this.inputElement;
if (!value) {
this.previewElement.innerHTML = '<span class="field-media-preview-icon"></span>';
} else {
let thumb = Joomla.selectedMediaFile.url;
this.previewElement.innerHTML = '';
const imgPreview = new Image();
if (Joomla.selectedMediaFile.thumb) {
thumb = Joomla.selectedMediaFile.thumb;
}
const mediaType = {
image() {
imgPreview.src = /http/.test(thumb) ? thumb : Joomla.getOptions('system.paths').rootFull + thumb;
imgPreview.setAttribute('alt', '');
},
};
mediaType[this.type]();
this.previewElement.style.width = this.previewWidth;
this.previewElement.appendChild(imgPreview);
}
}
}
Is this on hold or should it still be tested?
Can a maintainer please set the label "Conflicting Files"?
This should be already fixed by now
This pull request has automatically rebased to 4.2-dev.
What should we do with this PR @bembelimen @dgrammatiko
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-10-21 14:09:26 |
Closed_By | ⇒ | bembelimen | |
Labels |
Added:
Conflicting Files
?
NPM Resource Changed
?
Maintainers Checked
|
Is
thump_path
always the same as theurl
? If so then remove it in the Media manager Api, but I think that thump is for a thumbnail provided by some cloud storage providers (s3, dropbox)