Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi all.
We are having issues with the media field on node add/edit pages. After you upload the image and do all the step in Media browser modal, uploaded image is not rendered on the node edit page (thumbnail).
Comment | File | Size | Author |
---|---|---|---|
#27 | 7.x-2.22.png | 1.57 KB | vdsh |
#27 | 7.x-2.21.png | 25.13 KB | vdsh |
#15 | media-thumbnail_image_on_edit_page_after_upload_image-3067177-14.patch | 391 bytes | joseph.olstad |
Comments
Comment #2
mkrizaj CreditAttribution: mkrizaj at NDP commentedComment #3
mkrizaj CreditAttribution: mkrizaj at NDP commentedComment #4
mkrizaj CreditAttribution: mkrizaj at NDP commentedComment #8
joseph.olstadThanks!
Comment #9
SHEvents CreditAttribution: SHEvents commentedI don't know if this is the right place to raise this, and my apologies if I'm wrong, but when I enter a new YouTube video URL the thumbnail image is not rendered on the add/edit page. However, if I then 'save' the page, the video is uploaded and, when I return to 'edit', the thumbnail is shown rendered.
However, if I try to enter more than the one URL before saving the page, only the last URL entered is uploaded.
This means I am having to repeat the 'edit' then 'save' procedure on four separate occasions in order to enter four YouTube URLs.
All modules on my Drupal 7 site are up to date and it's running under PHP 7.1.
Very many thanks.
ps. I'm also having the same problem with photographs.
Comment #10
vdsh CreditAttribution: vdsh commentedI just updated to 7.x.22 - which includes this patch - and my thumbnails are now NOT rendering in the node add/edit page whereas it is working as expected if I revert this patch change.
So I guess there is something wrong or missing here to cover all cases
Comment #11
joseph.olstadOk I will revert this patch and cut a new release shortly... wtf
Comment #12
joseph.olstadI've tested the latest release on a couple sites already and media embedding worked with both wysiwyg module OR the media_ckeditor / ckeditor modules.
I'll run a few more tests though but I also looked at this javascript code in question above and it should not affect the rendering of the tokens at all.
However there may be something less obvious going on. It would be more helpful however if the above people reporting results could provide greater detail about the before and after such as which modules were updated and which versions used, which web browsers, which version of php, steps to reproduce, even if summarized (however please some detail if possible).
Comment #13
joseph.olstadany helpful messages in the watchdog or apache error logs? What version of php ? before and after steps.
Comment #14
SHEvents CreditAttribution: SHEvents commentedHi Joseph,
I updated to Media 7.x-2.22. I'm using Media: oEmbed 7.x-2.7.
My web browser is Safari 12.1.1 on a 21.5-inch mid-2011 iMac O/S 10.13.6. I'm running Drupal 7.67. PHP 7.1.30. My module and theme update status is "up to date".
For about three hours, immediately prior to updating to Media 7.x-2.22, I received an error message when trying to upload any YouTube video telling me that the video I was trying to upload was not a YouTube video, when they were, while the thumbnails were still working properly when I was uploading photographs. Immediately after updating to Media 7.x-2.22 I added the mime type 'video/youtube' and I could then enter YouTube videos, however thumbnails ceased to render.
If there is any further information I can provide or if you would like me to try changing any of my settings please let me know.
Richard
Comment #15
joseph.olstadHello @SHEevents (Richard),
Can you please try (apply) this patch and see if this fixes it? Here is instructions on how to apply a patch.
Comment #16
SHEvents CreditAttribution: SHEvents commentedJoseph,
I have applied the patch: ie by substituting "attachButton.trigger('mousedown');" for "attachButton.trigger('click');". However, there was no "-" against "attachButton.trigger('click');" on the patch you provided, so did you want me to keep 'click' as well as 'mousedown'? Apologies if you did.
However with just 'mousedown' the problem remains. Sorry.
Comment #17
SHEvents CreditAttribution: SHEvents commentedHi Joseph,
On the off chance you did want me to add "attachButton.trigger('mousedown');" and retain "attachButton.trigger('click');" I've now tried that but I'm afraid the problem remains.
Richard
Comment #18
joseph.olstadHi @SHEevents (Richard) ,
Seeing as you have confirmed that this commit is not the source of the problem, may I suggest the easiest way to check where the breakage is happening?
Here is what you do:
git clone the media module 7.x-2.x branch like this:
remove the downloaded media module
and replace it with:
git clone https://git.drupalcode.org/project/media.git
and git checkout backwards each commit until October 24th 2018, testing each time clearing all caches , if you tell me exactly which commit causes the break, I can look at that commit and we can look at a solution.
it will be quick because there's not many commits.
Comment #19
SHEvents CreditAttribution: SHEvents commentedThanks Joseph,
I'm afraid my Drupal expertise is far from great and I have no idea how to git clone the media module 7.x-2.x branch but I'll try to find out how to do so and let you know what happens. Apologies for putting you to all this trouble.
Richard
Comment #20
joseph.olstadHi @SHEevents please send me a private message here https://www.drupal.org/u/josepholstad and I can assist you directly as I'd like to solve this issue immediately, my reputation is on the line.
Comment #21
errand CreditAttribution: errand commentedHello, i have the same problem on my sites
one: PHP 7.0.27-0+deb9u1 + nginx nginx/1.10.3
updated from media 7.x-2.1 to 7.x.2.2
Second: PHP 7.2 + nginx 1.14
updated from media 7.x-2.1 to 7.x.4-beta
Not seeing thumbs but the file is being attached and visible on node view. And when i go to edit mode the thumb is visible.
Edit: downgrading to 7x.2.1 hepls
Comment #22
joseph.olstad@errand I suppose you meant to write 7.x-2.21 to 7.x-2.22
not 7.x-2.1
Currently investigating with Richard
otherwise, simply cloning the media module 7.x-2.x branch and moving forward or backward between commits between Oct 24 2018 and July 2019 , moving one commit at a time, testing each commit, will tell exactly which commit is causing this issue.
sorry for the inconvenience, would like to pinpoint this issue.
Comment #26
joseph.olstadok for whoever reported this issue, the change caused a regression so I am not accepting this change, so I reverted the changes.
Comment #27
vdsh CreditAttribution: vdsh commentedHey Joseph,
Thanks for picking up the issue.
Behavior on 7.x-2.21 (no patch) on Chrome on a node/new page after I add an image:
Same process but with 7.x-2.22, nothing is displayed at all, no error in the console nor in the app logs (only a message indicating that the file has been updated)
Upgrading to 7.x-2.23 again solves the issue
Note: in all of those versions, I have a console error in the media browser, which I think is linked to client side validation - and not related to that issue. I created https://www.drupal.org/project/clientside_validation/issues/3067552 to follow it
Hope it helps, let me know if you need more info
Comment #28
errand CreditAttribution: errand commented@joseph.olstad, you're right, thank you.
I confirm 7.x-2.23 thumbnail is rendering
Comment #29
joseph.olstadgreat yes, 7.x-2.23 release was tagged and pushed, for anyone using 7.x-2.22 , please upgrade to 7.x-2.23
Comment #30
joseph.olstadthis issue got messy, if the original report is still important then please open a new issue.
Comment #31
ron_s CreditAttribution: ron_s commentedI've not seen this issue with any recent Media release. I would suspect the original problem was due to something else.
For anyone having this problem, a likely possibility would be a JavaScript error that is causing Ajax to break and not render the thumbnail. Make sure to check your Developer Tools console to look for errors and warning messages.