Bookmark button class

AI-generated summary

A user, MasterShake, reported a bug where the Bookmark button on the topic view displays {{bookmarkClass}} instead of the actual CSS class. codinghorror initially checked the post-level bookmark button and found it working, but later confirmed the issue exists at the topic level, where the class attribute renders literally as {{bookmarkClass }} 4. MasterShake confirmed the bug also appears in Firefox. codinghorror tagged david to fix it, jokingly calling it “delegating” 5. david resolved the issue with a commit to the Discourse repository, referencing the fix and cc’ing awesomerobot. The bug affected the topic-level bookmark button’s class rendering, causing incorrect HTML output, and was fixed in the codebase.

Let me preface this by saying I’m no dev so go easy :sweat_smile:

I’ve noticed a class on the Bookmark button on the topic view “doesn’t get generated” (It just says {{bookmarkClass}} ) ?

2 Likes

Where exactly are you seeing that? Looks OK in your post, above, if I use the f12 browser inspector on the bookmark button, I see:

<button class="widget-button btn-flat bookmark no-text btn-icon" aria-label="bookmark this post" title="bookmark this post"><i class="fa fa-bookmark d-icon d-icon-bookmark" aria-hidden="true"></i></button>

Using inspector on this topic view. I havent checked other status’ of this to be fair so I cant account for other instances.

Edit:
Chrome: Version 69.0.3497.100 (Official Build) (64-bit)
OS: MacOS Mojave 10.14

2 Likes

Oh at the topic level. Sure.

Confirmed:

<button aria-label="Click to bookmark the first post on this topic" title="Click to bookmark the first post on this topic" id="ember1617" class="btn-default {{bookmarkClass}} btn btn-icon-text ember-view"> <i class="fa fa-bookmark d-icon d-icon-bookmark"></i><span class="d-button-label">Bookmark<!----></span></button>

We should fix that.. @david would you like the honors? :bowing_man:

2 Likes

Confirmed for FF too :slight_smile:

Edit: @codinghorror I believe they call that delegating :smiley:

Fixed in

https://github.com/discourse/discourse/commit/ff6676094f6e4cf7fbd3f962ee4d933c63c4f498

(cc @awesomerobot)

7 Likes

This topic was automatically closed after 30 hours. New replies are no longer allowed.