newbthenewbd / grav-plugin-tinymce-editor

TinyMCE Editor Integration Plugin for Grav
Other
60 stars 10 forks source link

Not loading images when inserting from page media #7

Closed webandrew closed 3 years ago

webandrew commented 6 years ago

After uploading a new image to page media, when using the insert option, I get a popup and all, but then the image doesn't appear in the tinymce until I save the document. Alternatively, I have to upload, save and then insert. Any way around this?

newbthenewbd commented 6 years ago

This is a known issue (see #3) that is hardly possible to fix when caused by messed up directory names, although the frequency I'm reminded of it hints to me that there might be something else to it.

Are You perhaps only using the admin panel for modifying pages, and otherwise manually editing the files, or is there anything else that's highly specific to Your configuration in terms of page creation?

webandrew commented 6 years ago

I'm only using the admin panel. Well, I'm preparing it. I'm looking into having some basic users being able to put up content. That's why TinyMCE is a lifesaver, since markdown is not an option. And problems with images would be quite unfortunate. ps. There's nothing specific about my configuration. Standard install + couple of basic plugins

webandrew commented 6 years ago

Actually, here's a screengrab of the problem: https://www.useloom.com/share/b5fde3cbcd89435ab55c017f13d908bf

webandrew commented 6 years ago

Ok, found the problem. It dies on filenames with a whitespace. I was just testing around the browsers and some other files started to work. I was using photos with whitespace in the name, and they weren't working. Can anything be done about that by any chance?

newbthenewbd commented 6 years ago

Whitespace? Very interesting, as the original issue is caused by caches not being generated at a point. Perhaps I got the cache filename formatting somewhat wrong?

I'm trying to debug this myself right now, and will see what can be done. Thanks for reporting!

newbthenewbd commented 6 years ago

Actually, what browser are You using if I may ask? This might be ugly-Javascript-bugs-specific...

webandrew commented 6 years ago

I've been having problems on Chrome. Started working on Edge, but since then I've noticed it was because of the whitespace, not the browser. Works fine on files without on both.

webandrew commented 6 years ago

Here, you can see me trying to use an image with and without whitespace. Edge has same problem https://www.useloom.com/share/221feba751ad4addb37258331a149ab8

newbthenewbd commented 6 years ago

Hrm, it's working fine for me. Maybe it's ~Windows~ encoding-specific? Quite sure not an easy thing to debug.

Could You verify that a file affected by this exists in the appropriate directory under user/pages before the page is saved and has the right name? For me, it does, and if it doesn't, that bug is bound to happen, but I'm unable to figure out what exactly makes it only appear after the save when whitespaces are used, aside from page renames...

webandrew commented 6 years ago

Both files are uploading correctly into the folder. And I'm not even touching page names.

Now, hope you won't hate me for this, but the problem dissipated. Don't know how. Stuff is working now, for no reason. Sorry for dragging you into this :)

newbthenewbd commented 6 years ago

Huh, interesting. That only proves that the bug is an ugly one, though, and not that it doesn't exist. The path to the page that You've been testing on was always same, right?

Keeping the issue open for now, either way; should probably figure out how to integrate direct download from user/pages rather than the web address with TinyMCE, but the way it has to be done makes that very hard, unfortunately.

webandrew commented 6 years ago

Yeah, I know. It's probably a conjunction with some other js event or error or something. Yes it is \pages\03.test in terms of directory.

webandrew commented 6 years ago

This thing pops up sometimes on me. Maybe it has an effect on it? Unfortunately it's a .min.js so readability is not great. Can't even trigger the error. Not sure what causes it. Managed to get 3 instances, but not sure what action causes it.

image

webandrew commented 6 years ago

Nope, wait.... found the error source. It's hovering over the View image

newbthenewbd commented 3 years ago

The architecture of the plugin has changed a lot since the submission of the issue. Should the problem still arise in v1.3.0 or newer, please notify - for now, closing.

Thank You!