pfaffman
(Jay Pfaffman)
November 3, 2017, 6:09pm
1
I just tried to import a theme from a file. When I select “from my device” I get the selector and choose the file, but then the “upload” button doesn’t do anything. I tested on two instances Discourse 1.9.0.beta13 and Discourse 1.9.0.beta14.
Tested Chome and Firefox on Linux.
3 Likes
Pad_Pors
(Pad Pors)
November 3, 2017, 6:50pm
2
I had the same problem with themes which has some files attached (as uploads). simple css-html themes without any attachment were ok.
2 Likes
jomaxro
(Joshua Rosenfeld)
November 3, 2017, 8:14pm
3
Hmm…I can’t reproduce this on a test hosted site. I exported and uploaded Theme Test and ran into no issues.
2 Likes
pfaffman
(Jay Pfaffman)
November 3, 2017, 8:54pm
4
Well here’s an error log:
Parameters: {"theme"=>#<ActionDispatch::Http::UploadedFile:0x00007fc32bc88958 @tempfile=#<Tempfile:/tmp/RackMultipart20171103-338-1gjeut6.json>, @original_filename="mrf-tweaks.dcstyle.json", @content_type="application/json", @headers="Content-Disposition: form-data; name=\"theme\"; filename=\"mrf-tweaks.dcstyle.json\"\r\nContent-Type: application/json\r\n">}
Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.5ms)
RuntimeError (Unknown type passed to set field)
/var/www/discourse/app/models/theme.rb:253:in `set_field'
This is strange because I downloaded this file from this very same server before uploading a new import.
cpradio
(cpradio)
November 3, 2017, 9:18pm
5
I’m assuming it has an upload/asset? I think that is the key to the error (if that is true for your case)
1 Like
pfaffman
(Jay Pfaffman)
November 3, 2017, 9:20pm
6
Yes. I see it now. Like
{
"name": "logo-square",
"target": "common",
"value": "",
"type_id": 2,
"upload_id": 7612,
"url": "/uploads/default/original/2X/e/eb4f8eaa4183d055ad75c5dfcf5010b67248862a.png",
"filename": "site-Square.png"
},
cpradio
(cpradio)
November 3, 2017, 9:26pm
7
If you comment out the filename for now (and re-upload it after), does it work?
pfaffman
(Jay Pfaffman)
November 3, 2017, 9:35pm
8
Hmm. I tried deleting the section I included above, and then tried deleting the “filename”: “fil.png” part (and preceding comma). But no joy.
You want me to PM you the file?
cpradio
(cpradio)
November 3, 2017, 9:39pm
9
Sure, I can play around with it on my sandbox tonight (or should be able to)
1 Like
pfaffman
(Jay Pfaffman)
November 3, 2017, 10:00pm
10
Removing the upload solved the problem. Definitely seems like a bug, though.
Thanks, @cpradio !
4 Likes
cpradio
(cpradio)
November 3, 2017, 10:08pm
11
I can definitely recreate the issue when there is an asset/upload as part of the theme, once that is removed, the import works fine.
5 Likes
sam
(Sam Saffron)
November 14, 2017, 5:31am
13
This is a rather hairy change, uploads are now base64 encoded in the json payload for theme export.
https://github.com/discourse/discourse/commit/47e4c9bb468fca10f4818df3bc44a67990eb75aa
8 Likes
sam
(Sam Saffron)
Closed
November 15, 2017, 7:00am
14
This topic was automatically closed after 25 hours. New replies are no longer allowed.