Falco
(Falco)
21 ביולי, 2015, 8:51pm
1
Custom emoji uploaded on a subfolder install point to wrong location, without the subfolder prefix.
diff --git a/app/models/emoji.rb b/app/models/emoji.rb
index d1dcab4..10313e4 100644
--- a/app/models/emoji.rb
+++ b/app/models/emoji.rb
@@ -47,7 +47,7 @@ class Emoji
extension = File.extname(path)
Emoji.new(path).tap do |e|
e.name = File.basename(path, ".*")
- e.url = "/#{base_url}/#{e.name}#{extension}"
+ e.url = "#{base_url}/#{e.name}#{extension}"
end
end
@@ -110,12 +110,12 @@ class Emoji
end
def self.base_directory
- "public/#{base_url}"
+ "public#{base_url}"
end
def self.base_url
db = RailsMultisite::ConnectionManagement.current_db
- "uploads/#{db}/_emoji"
+ "#{Discourse.base_uri}/uploads/#{db}/_emoji"
end
end
The patch above fix it, but I don’t know if they break non-subfolders installs.
3 לייקים
Possible this is a bug with subfolders, @neil can you have a look?
לייק 1
neil
(Neil Lalonde)
27 ביולי, 2015, 8:02pm
3
Even with your fixes, the emoji upload is broken with subfolders. I’ll spend more time on it.
2 לייקים
Falco
(Falco)
27 ביולי, 2015, 10:56pm
4
On a kinda related thing about custom emoji:
Installed discourse on my company
Financial company, lots of old people
Uploaded first custom emoji with company logo
Colleague asks where emoji is on the emoji dialog
After searching a bit I say: in the hankey section
I know I can change it, but maybe use another default?
2 לייקים
Hmm yeah, I agree, fine, but what’s a good Emoji that means “Custom goes here?” Suggestions?
לייק 1
sam
(Sam Saffron)
27 ביולי, 2015, 11:16pm
6
first uploaded emoji (or first non hanky) is probably a reasonable default.
לייק 1
Falco
(Falco)
27 ביולי, 2015, 11:21pm
7
I like it, maybe put a message before first upload saying this, and we have a deal
sam
(Sam Saffron)
27 ביולי, 2015, 11:23pm
8
you know we accept PRs for this kind of stuff
לייק 1
Falco
(Falco)
27 ביולי, 2015, 11:30pm
9
OK, will do this.
Just after The Internacional
לייק 1
OK, I normalized what we have with Slack:
Categories are:
People (smiley)
Nature (leaf)
Food & Drink (hamburger)
Celebration (gift)
Activities (football / soccer ball)
Travel & Places (airplane)
Objects & Symbols (glasses)
I also added a tabicon
field to the data structure so we can specify which emoji (by name) should be on the tab.
And I added a fullname
which could be used as the tooltip or complete name displayed for the category.
important side effect (which was kinda the point of this, not just to mimic Slack’s categories although they are clearly a bit better) the custom tab finally has only truly custom Emoji…
… not the confusing, weird mish-mash of “not categorized” official unicode Emoji and custom it had before. That was a bug in my opinion.
3 לייקים
Ok, @techapj did the last part of this – we can select which emoji is on each tab, and there is a proper category name + tooltip.
2 לייקים
neil
(Neil Lalonde)
24 באוגוסט, 2015, 8:27pm
12
FYI I added this fix for uploading emoji’s on a subfolder install.
3 לייקים
Falco
(Falco)
24 באוגוסט, 2015, 10:24pm
13
Just found it here . Good to know that my patch was useful
3 לייקים