# Development

**URL:** https://meta.discourse.org/c/dev/7.md?page=128

[Latest](https://meta.discourse.org/latest.md) · [Categories](https://meta.discourse.org/categories.md) · [Tags](https://meta.discourse.org/tags.md)

**Page:** 129

---

## [Infinite loop in email\_reply\_trimmer](https://meta.discourse.org/t/infinite-loop-in-email-reply-trimmer/69427)

<div class="topic-metadata">

**Author:** [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Replies:** 7\
**Last updated:** [September 23, 2017, 10:55pm UTC](https://meta.discourse.org/t/infinite-loop-in-email-reply-trimmer/69427 "2017-09-23T22:55:13Z")

</div>

this is a :bug:, but I think only developers will care about it. There’s an infinite loop in one of these replacements. I found it while running the nabble importer. I banged at it a bit before just commenting it out to …

---

## [Is it OK to just require bbcode-to-md in importers?](https://meta.discourse.org/t/is-it-ok-to-just-require-bbcode-to-md-in-importers/70541)

<div class="topic-metadata">

**Author:** [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Replies:** 1\
**Last updated:** [September 22, 2017, 10:07pm UTC](https://meta.discourse.org/t/is-it-ok-to-just-require-bbcode-to-md-in-importers/70541 "2017-09-22T22:07:37Z")

</div>

TL;DR: When I submit a PR for vbulletin.rb (I added support for assigning admins and moderators, and maybe something else), can I include code that requires ruby-bbcode-to-md so that it just works? Painful Explanation I…

---

## [How to alert admins if there is an error in a custom plugin?](https://meta.discourse.org/t/how-to-alert-admins-if-there-is-an-error-in-a-custom-plugin/70364)

<div class="topic-metadata">

**Author:** [@Bas](https://meta.discourse.org/u/Bas)\
**Replies:** 5\
**Last updated:** [September 20, 2017, 6:04pm UTC](https://meta.discourse.org/t/how-to-alert-admins-if-there-is-an-error-in-a-custom-plugin/70364 "2017-09-20T18:04:14Z")

</div>

We’re developing a custom plugin that has a recurring task scheduled, how should we alert admins if there are a lot of errors thrown?

---

## [Using category banner in subcategory](https://meta.discourse.org/t/using-category-banner-in-subcategory/70365)

<div class="topic-metadata">

**Author:** [@ganya](https://meta.discourse.org/u/ganya)\
**Replies:** 3\
**Last updated:** [September 20, 2017, 9:04am UTC](https://meta.discourse.org/t/using-category-banner-in-subcategory/70365 "2017-09-20T09:04:38Z")

</div>

Hello guys. Can I somehow use category banner, in subcategories, without uploading same images in subcategories ? Maybe I can use some code, or there is some settings parameter ?

---

## [Rubocop has landed on Discourse 👮‍♀️ 👮](https://meta.discourse.org/t/rubocop-has-landed-on-discourse-policewoman-policeman/67211)

<div class="topic-metadata">

**Author:** [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Replies:** 4\
**Last updated:** [September 19, 2017, 11:37pm UTC](https://meta.discourse.org/t/rubocop-has-landed-on-discourse-policewoman-policeman/67211 "2017-09-19T23:37:54Z")

</div>

https://github.com/discourse/discourse/commit/5012d46cbd3bcf79b7351f7d2d41003496a796c5 What is Rubocop? In short, RuboCop is a Ruby static code analyzer. Out of the box it will enforce many of the guidelines outlined …

---

## [Can I Change Push Notification For Discourse White Labeled Android App](https://meta.discourse.org/t/can-i-change-push-notification-for-discourse-white-labeled-android-app/70348)

<div class="topic-metadata">

**Author:** [@burningman](https://meta.discourse.org/u/burningman)\
**Replies:** 6\
**Last updated:** [September 20, 2017, 12:39am UTC](https://meta.discourse.org/t/can-i-change-push-notification-for-discourse-white-labeled-android-app/70348 "2017-09-20T00:39:47Z")

</div>

I convert my discourse forum to android app. But after installing app, I checked notification option in preference And I found that " This browser Is Not Supported For Push Notification" Is it start working if I enabled…

---

## [Possible to use the group select ui in a plugin?](https://meta.discourse.org/t/possible-to-use-the-group-select-ui-in-a-plugin/70082)

<div class="topic-metadata">

**Author:** [@eriko](https://meta.discourse.org/u/eriko)\
**Replies:** 3\
**Last updated:** [September 18, 2017, 4:49pm UTC](https://meta.discourse.org/t/possible-to-use-the-group-select-ui-in-a-plugin/70082 "2017-09-18T16:49:58Z")

</div>

I have a case where I want to be able filter actions in a plugin based on a users group membership. In the ui of the plugin I would like to use the auto complete and list limits of the existing ui for setting a users gr…

---

## [Set current User in Javascript](https://meta.discourse.org/t/set-current-user-in-javascript/70263)

<div class="topic-metadata">

**Author:** [@Imperator](https://meta.discourse.org/u/Imperator)\
**Replies:** 6\
**Last updated:** [September 18, 2017, 1:23pm UTC](https://meta.discourse.org/t/set-current-user-in-javascript/70263 "2017-09-18T13:23:54Z")

</div>

Hello, i will use Discourse.User.currentProp(‘username’) or Discourse.User.currentProp(‘id’) in a design Insert in Admin / Customize / CSS/HTML / \</body\> \<scirpt\> alert(Discourse.User.currentProp('username')); \</scrip…

---

## [From \_t cookie how to get the current user id?](https://meta.discourse.org/t/from--t-cookie-how-to-get-the-current-user-id/70220)

<div class="topic-metadata">

**Author:** [@vikaskedia](https://meta.discourse.org/u/vikaskedia)\
**Replies:** 2\
**Last updated:** [September 17, 2017, 7:33pm UTC](https://meta.discourse.org/t/from--t-cookie-how-to-get-the-current-user-id/70220 "2017-09-17T19:33:30Z")

</div>

I am trying to develop an app using the same DB as discourse. Discourse is run from: www.example.com/forums/ The app is run from: www.example.com/app/ Inside /app/ app on server side I have access to \_t token. From…

---

## [\[Solved\] Dev instance with nginx: topic preview not working](https://meta.discourse.org/t/solved-dev-instance-with-nginx-topic-preview-not-working/67738)

<div class="topic-metadata">

**Author:** [@jack2](https://meta.discourse.org/u/jack2)\
**Replies:** 6\
**Last updated:** [September 16, 2017, 5:25pm UTC](https://meta.discourse.org/t/solved-dev-instance-with-nginx-topic-preview-not-working/67738 "2017-09-16T17:25:59Z")

</div>

When clicking “New Topic” in my dev instance, I get the following errors in the console and the preview pane doesn’t work: Uncaught SyntaxError: Unexpected token \< markdown-it-bundle.js:1 Error: Could not find …

---

## [Incomplete model when a topic has just been created](https://meta.discourse.org/t/incomplete-model-when-a-topic-has-just-been-created/66716)

<div class="topic-metadata">

**Author:** [@jack2](https://meta.discourse.org/u/jack2)\
**Replies:** 2\
**Last updated:** [September 15, 2017, 1:10pm UTC](https://meta.discourse.org/t/incomplete-model-when-a-topic-has-just-been-created/66716 "2017-09-15T13:10:57Z")

</div>

From the didTransition hook of a topic.\* route, I access the parent’s model with this.modelFor('topic'). This works very well, except in one case: when the topic has just been created (with the API), the model I get fro…

---

## [Failing tests in discourse\_dev due to multisite](https://meta.discourse.org/t/failing-tests-in-discourse-dev-due-to-multisite/68720)

<div class="topic-metadata">

**Author:** [@LeoMcA](https://meta.discourse.org/u/LeoMcA)\
**Replies:** 11\
**Last updated:** [September 14, 2017, 4:29pm UTC](https://meta.discourse.org/t/failing-tests-in-discourse-dev-due-to-multisite/68720 "2017-09-14T16:29:31Z")

</div>

I’ve been having some problems with failing tests in the discourse\_dev docker image, and I assume they’re down to the addition of multisite tests. When creating a new container, or running RAILS\_ENV=test rake db:migrate …

---

## [How to rescue 404s from FileHelper.download](https://meta.discourse.org/t/how-to-rescue-404s-from-filehelper-download/69998)

<div class="topic-metadata">

**Author:** [@vinothkannans](https://meta.discourse.org/u/vinothkannans)\
**Replies:** 0\
**Last updated:** [September 13, 2017, 7:08pm UTC](https://meta.discourse.org/t/how-to-rescue-404s-from-filehelper-download/69998 "2017-09-13T19:08:19Z")

</div>

In above code whenever FileHelper.download function fail I need to findout the reason for failing. Whether the file is not found (404) or failed for some other reason.

---

## [Private Message Page Performance](https://meta.discourse.org/t/private-message-page-performance/39865)

<div class="topic-metadata">

**Author:** [@Falco](https://meta.discourse.org/u/Falco)\
**Replies:** 5\
**Last updated:** [September 13, 2017, 2:30pm UTC](https://meta.discourse.org/t/private-message-page-performance/39865 "2017-09-13T14:30:26Z")

</div>

Continuing the discussion from Improve performance of Topic load - ORDER BY RANDOM: The added index is great, but it excludes PMs :sadpanda:. Since we have suggested topics on the PM page (since when?) the performance …

---

## [How to generate nonce from client-side Javascript](https://meta.discourse.org/t/how-to-generate-nonce-from-client-side-javascript/69767)

<div class="topic-metadata">

**Author:** [@ratebeer](https://meta.discourse.org/u/ratebeer)\
**Replies:** 3\
**Last updated:** [September 13, 2017, 1:08am UTC](https://meta.discourse.org/t/how-to-generate-nonce-from-client-side-javascript/69767 "2017-09-13T01:08:23Z")

</div>

I am using \<script type="text/discourse-plugin" version="0.8.9"\> in my instance’s \<head\> and it provides me access to the api object. What I can’t figure out however, is how to generate a nonce with it. I’m detecting wh…

---

## [Discourse API SSO sync fails to find record](https://meta.discourse.org/t/discourse-api-sso-sync-fails-to-find-record/69911)

<div class="topic-metadata">

**Author:** [@bufordtaylor](https://meta.discourse.org/u/bufordtaylor)\
**Replies:** 4\
**Last updated:** [September 12, 2017, 11:37pm UTC](https://meta.discourse.org/t/discourse-api-sso-sync-fails-to-find-record/69911 "2017-09-12T23:37:45Z")

</div>

I’m attempting to update the email records of a user via the API. Here’s me finding the record by external\_id: \[20\] pry(main)\> c.by\_external\_id("1388") =\> { "id" =\> 2, …

---

## [VersionTag Plugin no longer works; implementing MarkdownIt-API Calls seems not to work](https://meta.discourse.org/t/versiontag-plugin-no-longer-works-implementing-markdownit-api-calls-seems-not-to-work/69629)

<div class="topic-metadata">

**Author:** [@nstoecki42](https://meta.discourse.org/u/nstoecki42)\
**Replies:** 0\
**Last updated:** [September 8, 2017, 1:17pm UTC](https://meta.discourse.org/t/versiontag-plugin-no-longer-works-implementing-markdownit-api-calls-seems-not-to-work/69629 "2017-09-08T13:17:42Z")

</div>

Hi folks! after my plugin stopped working I tried to adapt it to the new API but I didn’t succeed. Here is my code: ▶ 'discourse-versiontag/assets/javascripts/lib/discourse-markdown/versiontag.js.es6' Could you point me…

---

## [Using Discourse as a WebApp Messaging Engine](https://meta.discourse.org/t/using-discourse-as-a-webapp-messaging-engine/69665)

<div class="topic-metadata">

**Author:** [@meatlessmondays](https://meta.discourse.org/u/meatlessmondays)\
**Replies:** 0\
**Last updated:** [September 8, 2017, 8:08pm UTC](https://meta.discourse.org/t/using-discourse-as-a-webapp-messaging-engine/69665 "2017-09-08T20:08:58Z")

</div>

I have a webapp that needs users to be able to privately message each other while allowing admins to verify discussions/agreements. I am leveraging Discourse’s robust API to create a new user and send a message to a pote…

---

## [Analyze the amount of topics](https://meta.discourse.org/t/analyze-the-amount-of-topics/69649)

<div class="topic-metadata">

**Author:** [@SidV](https://meta.discourse.org/u/SidV)\
**Replies:** 0\
**Last updated:** [September 8, 2017, 4:57pm UTC](https://meta.discourse.org/t/analyze-the-amount-of-topics/69649 "2017-09-08T16:57:54Z")

</div>

I need some help with this query. The idea is to be able to analyze the amount of topics that have a certain user, to get specific statistics on the behavior of the user. Of the total of topics created, I need to get: …

---

## [How to add a custom toolbar button via external JS?](https://meta.discourse.org/t/how-to-add-a-custom-toolbar-button-via-external-js/69645)

<div class="topic-metadata">

**Author:** [@godlike](https://meta.discourse.org/u/godlike)\
**Replies:** 0\
**Last updated:** [September 8, 2017, 4:22pm UTC](https://meta.discourse.org/t/how-to-add-a-custom-toolbar-button-via-external-js/69645 "2017-09-08T16:22:24Z")

</div>

Hi there, I develop an image hosting script (Chevereto) and I’m building a universal JS plugin that aims to add external image hosting support for a wide range of forum CMS and websites in general. The idea is to achiev…

---

## ["The time spent in V8 during page load of meta.discourse.org seems to drop by like 13% with these changes"](https://meta.discourse.org/t/the-time-spent-in-v8-during-page-load-of-meta-discourse-org-seems-to-drop-by-like-13-with-these-changes/69572)

<div class="topic-metadata">

**Author:** [@Sujan](https://meta.discourse.org/u/Sujan)\
**Replies:** 1\
**Last updated:** [September 8, 2017, 12:37am UTC](https://meta.discourse.org/t/the-time-spent-in-v8-during-page-load-of-meta-discourse-org-seems-to-drop-by-like-13-with-these-changes/69572 "2017-09-08T00:37:28Z")

</div>

Besides just micro-benchmarks, it’s obviously also interesting to see direct real-world impact of such changes. Not a lot of websites are dominated by for..in peak performance in a way that it makes a real difference,…

---

## [Returning Topic User avatar template with RSS feed](https://meta.discourse.org/t/returning-topic-user-avatar-template-with-rss-feed/69354)

<div class="topic-metadata">

**Author:** [@simon](https://meta.discourse.org/u/simon)\
**Replies:** 0\
**Last updated:** [September 4, 2017, 10:41pm UTC](https://meta.discourse.org/t/returning-topic-user-avatar-template-with-rss-feed/69354 "2017-09-04T22:41:07Z")

</div>

Could topic.user.avatar\_template be returned with the latest and top RSS feed? It’s possible to get it with a API call, but it’s an expensive query if you’re looping through multiple items. There might be a more standard…

---

## [Error When creating custom plugin](https://meta.discourse.org/t/error-when-creating-custom-plugin/69426)

<div class="topic-metadata">

**Author:** [@afall](https://meta.discourse.org/u/afall)\
**Replies:** 8\
**Last updated:** [September 5, 2017, 9:43pm UTC](https://meta.discourse.org/t/error-when-creating-custom-plugin/69426 "2017-09-05T21:43:07Z")

</div>

Dear Discourse Community, So I am following the instructions on Developing Discourse Plugins - Part 1 - Create a basic plugin to create a discourse plugin, but everytime I add a new sub-directory in the plugins folder, …

---

## [Pull 4961 question](https://meta.discourse.org/t/pull-4961-question/69429)

<div class="topic-metadata">

**Author:** [@Brian\_Martin](https://meta.discourse.org/u/Brian_Martin)\
**Replies:** 1\
**Last updated:** [September 5, 2017, 8:54pm UTC](https://meta.discourse.org/t/pull-4961-question/69429 "2017-09-05T20:54:35Z")

</div>

The following PR and Commit was flagged as SECURITY: https://github.com/discourse/discourse/pull/4961 https://github.com/discourse/discourse/pull/4961/commits/7023260786524fe7fde2043268a6283bdf461c1a Can anyone explai…

---

## [How Discourse implements Auth w/ Ember](https://meta.discourse.org/t/how-discourse-implements-auth-w-ember/69423)

<div class="topic-metadata">

**Author:** [@Craig\_Kahle](https://meta.discourse.org/u/Craig_Kahle)\
**Replies:** 0\
**Last updated:** [September 5, 2017, 7:35pm UTC](https://meta.discourse.org/t/how-discourse-implements-auth-w-ember/69423 "2017-09-05T19:35:35Z")

</div>

I am wondering, on a high level, how Discourse handles authentication in Ember. In the Discourse github repo, it looks like a Rails session cookie is being used to manage user state. I am not sure where the object that i…

---

## [304 response accessing admin url logged in as admin](https://meta.discourse.org/t/304-response-accessing-admin-url-logged-in-as-admin/69375)

<div class="topic-metadata">

**Author:** [@Jen\_Lijo](https://meta.discourse.org/u/Jen_Lijo)\
**Replies:** 1\
**Last updated:** [September 5, 2017, 2:23pm UTC](https://meta.discourse.org/t/304-response-accessing-admin-url-logged-in-as-admin/69375 "2017-09-05T14:23:58Z")

</div>

Hi, In dev mode, I’m trying to access a url in the browser that’s only visible for admins. I’m getting a Oops! That page doesn’t exist or is private. in the frontend, even tho I am logged in as an admin. The logs are th…

---

## [Get last ❤ via API](https://meta.discourse.org/t/get-last-heart-via-api/69163)

<div class="topic-metadata">

**Author:** [@juliano](https://meta.discourse.org/u/juliano)\
**Replies:** 2\
**Last updated:** [September 4, 2017, 2:37pm UTC](https://meta.discourse.org/t/get-last-heart-via-api/69163 "2017-09-04T14:37:39Z")

</div>

Hello, I want to use the Discourse API to get the last like or :heart:, that was given by any user on any topic for a specific Discourse instance. Unfortunately I have not found a good way of achieving this. Trying to c…

---

## [Plugin JavaScript wasn't loaded](https://meta.discourse.org/t/plugin-javascript-wasnt-loaded/69217)

<div class="topic-metadata">

**Author:** [@Yunhe\_Guo](https://meta.discourse.org/u/Yunhe_Guo)\
**Replies:** 0\
**Last updated:** [September 1, 2017, 4:40pm UTC](https://meta.discourse.org/t/plugin-javascript-wasnt-loaded/69217 "2017-09-01T16:40:32Z")

</div>

Here is my plugin code GitHub - openSUSE-zh/discourse-username-localization: Localized username support. · GitHub I want to load a JavaScript file assets/javascripts/discourse/initializers/override-username-match.js.es6 …

---

## [iOS 11 embedded Safari changes](https://meta.discourse.org/t/ios-11-embedded-safari-changes/69172)

<div class="topic-metadata">

**Author:** [@david](https://meta.discourse.org/u/david)\
**Replies:** 1\
**Last updated:** [August 31, 2017, 8:41pm UTC](https://meta.discourse.org/t/ios-11-embedded-safari-changes/69172 "2017-08-31T20:41:00Z")

</div>

I recently updated my iPhone to the public beta of iOS 11, and noticed an annoying change which impacts the Discourse app. I’m not sure there’s actually much we can do about it, so this is more of a heads-up. This is not…

---

## [Modifying/using highlight.js](https://meta.discourse.org/t/modifying-using-highlight-js/69073)

<div class="topic-metadata">

**Author:** [@Bas](https://meta.discourse.org/u/Bas)\
**Replies:** 4\
**Last updated:** [August 31, 2017, 3:12pm UTC](https://meta.discourse.org/t/modifying-using-highlight-js/69073 "2017-08-31T15:12:19Z")

</div>

Heya, I’m trying to get the following plugin for Highlight.js to work. https://github.com/wcoder/highlightjs-line-numbers.js Problem is that I don’t seem to have access to the hljs object and I am at a total loss as t…

[Previous page](https://meta.discourse.org/c/dev/7.md?page=127)

[Next page](https://meta.discourse.org/c/dev/7.md?page=129)
