Problem/Motivation
PDF placeholder thumbnails are not rendering in the file browser grid/list view.
The JavaScript responsible for injecting the placeholder image contains invalid
middle-dot characters (·) instead of spaces inside the HTML string.
Because of this, the generated <img> tag is malformed
and not parsed correctly by the browser.
Problematic code:
$(thumbnailWrapper[i]).prepend(
'<img·style="width:100px;·height:100px;"·src="/modules/contrib/file_browser/images/document_placeholder.svg"/>'
);
Steps to reproduce
- Open the File Entity Browser widget.
- Upload or select a PDF file.
- Observe that no thumbnail placeholder icon is displayed.
- Inspect the DOM and verify the image tag markup is invalid.
Proposed resolution
Replace the middle-dot characters with proper spaces in the HTML string.
$(thumbnailWrapper[i]).prepend( '<img style="width:100px; height:100px;" src="/modules/contrib/file_browser/images/document_placeholder.svg"/>' );

Remaining tasks
- Replace invalid characters with spaces in the JavaScript file.
- Verify PDF placeholder thumbnails render correctly.
- Test across supported browsers.
User interface changes
- PDF files will display a placeholder thumbnail icon.
- No layout or workflow changes.
API changes
- None.
Data model changes
- None.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | fix-malformed-img-tag-causing-missing-PDF-thumbnails.patch | 911 bytes | sriram_s |
Issue fork file_browser-3573734
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
sriram_s commentedComment #3
sriram_s commentedComment #4
sriram_s commentedComment #7
daniel.j commentedMoved patch change into branch and openned MR.
Comment #8
d.fisher commentedThis looks good to me. Marking RTBC. Changing target branch to 2.x-dev.
Comment #9
d.fisher commentedFixed and released in 2.0.8. Thank you for the report, the fixes, the reviews etc.