pushtype / push_type

PushType is a modern, open source content management system for Ruby on Rails.
http://www.pushtype.org
Other
290 stars 32 forks source link

Trouble with media upload as of 0.9.5 #17

Closed alexbrinkman closed 8 years ago

alexbrinkman commented 8 years ago

I'm having an issue uploading media from the media view. It works fine from within a node from the wysiwyg editor. I can also get it to work just fine with the drag and drop. However, if I click in the file upload area, select a file, no file ends up getting uploaded. Also, if I click the "Update Media" button for a previously uploaded image, I get the following error:

No route matches [PATCH] "/cms/media/a721881e-9e1a-40e5-bda2-8ef7c71245c4/%7B%7B%20saveUrl%20%7D%7D"

My dragonfly datastore is set to :file.

I just upgraded from 0.9.2 to 0.9.5, and I don't think we had this issue in 0.9.2, but I don't know that for sure.

Let me know if there is any other info I can provide to help.

aaronrussell commented 8 years ago

I can't recreate this locally but it sounds like a JavaScript problem. Can you let me know what browser you're using and if possible open up the browser console and let me know if it's spitting out any errors.

I did upgrade a lot of the JS dependencies in 0.9.4 which broke a few things - which is why I yanked that version and released 0.9.5. It's possible there more problems related to that.

alexbrinkman commented 8 years ago

I tried it on Chrome 54 and Firefox 49. I don't see any errors in the dev console on either browser. I could make a screencast of the issue if that would help.

aaronrussell commented 8 years ago

I think I got half of this - there's two problems right?

  1. When creating a new asset, if you click on the drop zone and manually select a file, nothing happens. The expected behaviour is that the file is automatically uploaded. I can recreate this one and am looking in to it now.
  2. When you are editing an existing asset (eg, changing it's description) then when clicking update asset you get an application error. The fact that the url ends with %7B%7B%20saveUrl%20%7D%7D tells me that JavaScript has thrown a wobbly. This is the one I can't recreate - works fine. Does this happen all the time for you or just once? If so then maybe JavaScript broke somewhere else down the line.
alexbrinkman commented 8 years ago

Yes, exactly. The {{saveUrl}} issue happens whenever I update the description. I created a screencast of the issue: http://screencast-o-matic.com/watch/cDXeFujsyx

alexbrinkman commented 8 years ago

Sorry, I do show the one error in the console: TypeError: Cannot read property 'getElementsByTagName' of null(…) [onloadwff.js:1569] Maybe that helps?

aaronrussell commented 8 years ago

What is onloadwff.js? Maybe a browser extension?

You say you've tried this in Firefox too. Does that have the same error?

alexbrinkman commented 8 years ago

It looks like onloadwff.js is part of the LastPass extension, that doesn't help.

I don't see any helpful errors in the Firefox dev tools either.

alexbrinkman commented 8 years ago

I disabled LastPass and all other Chrome extensions just to be sure, and I still get the error.

aaronrussell commented 8 years ago

The above commit sorts the first issue.

The second issue has me stumped.

alexbrinkman commented 8 years ago

Ok, thanks for looking into it. I'll try to dig into it that second issue too, I just don't know the combo of Vue/Turbolinks/Foundation very well it takes me a while to figure out what's going on with front end issues.

aaronrussell commented 8 years ago

@alexbrinkman just a headsup, I've released a beta version of 0.10.0 - and I think I might have fixed this bug. But as I could never recreate it I can't really verify.

Before you jump ahead and download 0.10.0.beta.1 - there are some reasonably significant changes to routing and the way mount_push_type works.

If you want to customise the mount points it's done on a per-engine basis now, eg:

mount_push_type admin: 'cms', front_end: 'blog'

I'll post more details on the forum tomorrow.

alexbrinkman commented 8 years ago

Ok, great, thanks for the heads up.

aaronrussell commented 8 years ago

@alexbrinkman not sure if you tried the beta... hope you didn't as it wasn't at all stable 😜

The latest beta (4) for version 0.10.0 is much more stable so you might want to try it out now. It hopefully fixes the issue above.

Read the upgrade notes for 0.10.0 as there are a few breaking changes to be aware of.

alexbrinkman commented 8 years ago

@aaronrussell I did not yet try the beta, sounds like my timing worked out. I'll be doing the update in the next week or so and will let you know if I run into anything. Thanks for the note on the breaking changes, they all seem like good decisions to me.