Quantcast
Channel: Discourse Meta - Latest topics
Viewing all 60707 articles
Browse latest View live

Sorting by Category

$
0
0

@jens wrote:

Hi!

When I tried sorting the topic list by category today, I noticed several things off:

  1. The list is sortable by category at all. I don't really see the use case.
  2. Opening meta.discourse.org and clicking on the category header sorts the list by category. Scrolling down does not load additional topics.
  3. Opening meta.discourse.org and clicking on "latest", then on the category header does not sort the list, but generates the javascript error

    Uncaught TypeError: Cannot set property 'order' of undefined
    RestModel.extend.refreshSort @ /discourse/models/topic-list:51
    controllerOpts.actions.changeSort @ /discourse/controllers/discovery/topics:29
    Mixin.create.send @ /production/ember:29423
    Mixin.create.triggerAction @ /production/ember:33333
    View.extend.sendAction @ /production/ember:38991
    (anonymous function) @ /discourse/components/topic-list:53
    on @ /discourse/components/topic-list:43
    exports.default.Ember.Component.extend.click @ /discourse/components/topic-list:52
    EmberObject.extend.trigger @ /production/ember:39524
    apply @ /production/ember:19209
    superWrapper @ /production/ember:18780
    merge.handleEvent @ /production/ember:39739
    CoreView.extend.handleEvent @ /production/ember:41827
    Backburner.run @ /production/ember:195
    Backburner.join @ /production/ember:218
    run.join @ /production/ember:17510
    exports.default.EmberObject.extend._bubbleEvent @ /production/ember:37392
    (anonymous function) @ /production/ember:37343
    n.event.dispatch @ /production/jquery-2.1.1.min:4
    n.event.add.r.handle @ /production/jquery-2.1.1.min:4

  4. Opening meta.discourse.org/?order=category directly, displays the sorted list. Scrolling down loads additional topics as expected. When I click the sort button now, the sort order is correctly reversed, but scrolling down does not load additional topics.

Cheers
Jens

Posts: 1

Participants: 1

Read full topic


Good News story on SLACK - Features

$
0
0

@BCHK wrote:

I still think that there is a lot that Discourse can learn from some elements of Slack - especially in terms of onboarding and user-motivating approaches - so to as increase the stickiness and user engagement in the app. And - I think a comment in the article highlights the issue with email notifications that Discourse currently uses:

"A 2012 Pew study found that only 6 percent of teenagers email every day, while 63 percent text daily. “Slack just nailed the user interface at the exact moment when people were finally like, God, fuck email,”

Here is a good story on SLACK from Slate.com that highlights some of these features:

http://www.slate.com/articles/technology/users/2015/04/slack_and_the_office_chat_several_people_are_typing_who_s_working.single.html?utm_source=nextdraft&utm_medium=email

Posts: 9

Participants: 6

Read full topic

A few enhancements for the wp-discourse plugin

$
0
0

@pjv wrote:

I've put a few pull requests into the hopper on github for the wp-discourse plugin that fix a bug and add a couple minor features to the plugin to fit how I want to use it as I have been integrating Discourse into an existing WordPress site that I manage. I thought I would post a little summary about them here.

  1. In the HTML template for each comment there is a comment-meta item that is the datetime for when the comment was posted. That data is supposed to be wrapped with an HTML <time> tag. But that tag is not on WordPress's global list of allowed tags and so it was getting filtered out of the HTML that was being output on the front end. I just added the <time> tag to the list of allowed tags for the sake of the wp-discourse plugin to fix this. See: https://github.com/discourse/wp-discourse/pull/135

  2. The way the plugin was formatting the datetime from the Discourse comment, it was only using the format string for a date from the WP site's preferences. So the datetime was only a date (no time). I added a new custom datetime format string to the admin that allows you to format the datetime string however you want, consistent with WordPress datetime formatting options. See: https://github.com/discourse/wp-discourse/pull/136

  3. The last one is my answer to what to do about enabling Discourse comments for existing WP posts/pages that have a lot of valuable pre-existing WP comments on them. It would be nice to be able to cleanly export WP comments into Discourse, but there is no currently existing importer for standard WP comments and there are a lot of edge cases that make developing one too big a chore for me. The current behavior of the wp-discourse plugin makes you choose to either show Discourse comments and hide the old WP comments OR show the WP comments and not show the Discourse comments. This patch lets you enable Discourse comments for existing posts and choose to show the existing WP comments as a "historical archive" beneath the new Discourse comments. See: https://github.com/discourse/wp-discourse/pull/137

Posts: 1

Participants: 1

Read full topic

Sortable Tables in Wiki-Style Posts?

$
0
0

@BrettBoval wrote:

Is it possible to have sortable tables for wiki-style posts? This may be outside the scope of the "civilized discussion" mandate, but would be useful as an common information source that is built at the beginning of the thread and referenced for the rest of the discussion.

Posts: 2

Participants: 2

Read full topic

How to upgrade DO to higher plan?

$
0
0

@trandatnh wrote:

I'm using DO $10 plan for my forum. However, the forum is quite lagging when there are around 20-40 concurrent users. I am going to upgrade DO to $20 plan, could anyone guide me an easy way to upgrade to new plan with less impact to user experience?

Posts: 4

Participants: 2

Read full topic

Redirect to requested URL after SSO

$
0
0

@casey wrote:

The Scenario:

We have a private, login required, Discourse installation that is relying on an external php/CodeIgniter site for SSO.
SSO is working to sign in users just fine.

The Problem:

When someone tries to hit a URL on the private Discourse site they're redirected to the SSO login and hence the login form on the external site immediately.
After login they're then directed to the root of the Discourse site, not the originally requested URL.
I've tried getting the referring url at the SSO endpoint but $_SERVER['HTTP_REFERER']; is empty.

Am I missing something that will allow me to send them back to the originally requested URL on the Discourse site?

Posts: 3

Participants: 3

Read full topic

Emailed comments on the wrong thread

$
0
0

@watchmanmonitor wrote:

Continuing the discussion from Admin: Badge icon vs. image - what's the difference?:

Yes, via email.. and I've noticed a handful of times when emails from our users land on the wrong topic. I have been attributing it to user-error, since most replies by email happen as expected.

I end up moving the replies where they belong.. but maybe @downey can check his sent and let us know for certain which thread this reply was sent to?

Posts: 7

Participants: 4

Read full topic

How can a topic be considered `Top`?

$
0
0

@trandatnh wrote:

I can see from our Top menu:

  • the topic "Less Frequent..." is 1st
  • the topic "Should be..." is 3rd

While 3rd topic has more replies and views and same last activity.

The only different I can find is the creation day of 3rd topic is much older than 1st topic. Could anyone explain me how do we calculate the "hot" or "top" score of a topic?

Posts: 4

Participants: 3

Read full topic


SMTP, Exchange Server problem

$
0
0

@hendrikweiler wrote:

Hi,

ive tried to install a discourse instance using docker.

It works so far that i got everything working except the mailing.

Im trying to use an exchange server account for sending mails.
But i always get

504 5.7.4 Unrecognized authentication type

when i try to test it inside of the admin panel.

My settings:

address	192.168.0.114
port	39
user_name	user
authentication	plain
enable_starttls_auto	false

I found this link https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326/2
and tried to set the notification_email to the email adress of the email user with, since its required to send an email via exchange server:

./launcher enter app
rails r "SiteSetting.notification_email = 'discourse@yoursite.com'"
exit

But all i get always:

/usr/local/bin/rails: line 3: [: too many arguments

Im using 1.3.0.beta5

I dont know what im missing to get it working.

Posts: 3

Participants: 2

Read full topic

Exception CookieOverflow

$
0
0

@skyeagle wrote:

I caught a lot of ActionDispatch::Cookies::CookieOverflow exceptions. The below line of code is the culprit:

The referer url can be larger enough. You'd better limit it.

Posts: 2

Participants: 2

Read full topic

Google oauth2 and Facebook logins give 502 bad gateway errors

No unicorns or buffers

$
0
0

@downey wrote:

Continuing the discussion from How to upgrade DO to higher plan?:

Hmm. My containers/app.yml doesn't have any lines for UNICORN_WORKERS or db_shared_buffers. Should I be worried? worried

Is this maybe because I installed Discourse too long ago? If so it makes me wonder what non-optimal legacy settings I might have....

Posts: 2

Participants: 2

Read full topic

Indication of whether a post actually has saved

$
0
0

@clay wrote:

I've had 3-4 instances (over the past 6 months) when I've written a long post, clicked either "Create Topic" or "Reply," and felt that the post saved to the database because I was instantly shown it in situ in the Discourse interface. However, upon browsing away from the post, I discovered that it actually hadn't saved. In fact, it wasn't present at all. Usually, then clicking Reply or New Topic will show me a partial version of the post I wrote.

While I haven't been able to reproduce the problem and I recognize that it likely is because my Internet connection dropped out or otherwise was flaky, it was incredibly frustrating to lose the bulk of what I wrote. Had I known that the posts actually did not save, I could have copied the text from them to a text editor and then tried again.

It would be nice to have some type of indication (or something more obvious?) that a post I just wrote and tried to submit actually was captured by the system. During editing, the "saved" text appears at the bottom of the edit panel. However, unless I'm completely missing it, there doesn't seem to be any corollary for when you actually click "Create Topic" or "Reply."

Posts: 1

Participants: 1

Read full topic

Embedding Discourse in an app without custom header

$
0
0

@BerryBlue wrote:

I have my Discourse forums embedded in an iOS app. I have a custom header but I don't want it visible when viewing in the app. I only want it visible when viewing in Safari. It is possible to do this?

Posts: 1

Participants: 1

Read full topic

Upgrading our front end models to use a store

$
0
0

@eviltrout wrote:

The long battle of upgrading Discourse's Javascript from constants to ES6 modules finally has an end in sight. The vast majority of Javascript files we use to serve up Discourse have been converted to ES6 modules and are working great in production.

Having said that, there are some holdouts in our code base that have not been converted yet, mainly because they are difficult. In particular, our Model/data fetching infrastructure hasn't been upgraded in years and has a lot of room for improvement.

The Old Way to fetch data

Right now, the standard way to fetch data is to perform a Discourse.ajax call, then to wrap the result in an instance of the model you want. For example:

Widget = Ember.Object.extend();

Widget.reopenClass({
  find(id) {
    return Discourse.ajax("/widget/" + id + ".json").then((result) => {
      return Widget.create(result);
    });
  }
});

With the above code, you could say Widget.find(123) and get a promise that will resolve into a Widget.

This approach is not bad, it has obviously scaled up to our needs so far and kept our data layer simple. However, there is a lot of room for improvement:

  • We repeat ourselves a lot. On the server side we use a REST convention but the client side ends up making the same kinds of calls a lot.

  • For more complex objects (that contain side loaded or embedded objects) the finders become more complex.

  • It has no concept of an identity map, introducing potential bugs as the same object can be loaded twice in memory.

The New way to fetch Data

The new Discourse betas have a store injected into routes, controllers and models. If you've used ember-data in the past this concept is familiar to you and that is no coincidence. The new API is similar to ember data but is based off Discourse's needs and is considerably simpler. It can be seen as us stealing many of the ideas of ember data but without going full hog down that road.

I've been slowly building up the store over the last few features I've built and the API is finally stable and good enough to use so I recommend it for all new features.

The core idea is you ask the store for data. For example, to find the widget in the example about you'd do this instead:

this.store.find('pet', 123);

The above code will automatically make a GET request to /pets/123.json. You don't have to write any more code in Discourse to do this. You don't have to define a pet model or hardcode the pets path or anything like that. The store will make the request, find the pet in the returned JSON and return it to you as an instance of RestModel.

RestModel is the new base class for our models. Since we didn't define a Pet model, we'll just get an instance of that. However, if we did want to return an instace of Pet instead we could define a class like this.

// discourse/models/pet.js.es6
import RestModel from 'discourse/models/rest';

export default RestModel.extend({
  bark() {
    console.log('woof');
  }
});

If a Pet model is defined, the store will automatically instantiate it for you. If not, no bother.

RestModel instances come with some handy methods. For example, let's say you want to update a Pet's name. You could do this:

pet.update({ name: 'rover' });

That will automatically make a PUT request to /pets/:pet_id with the name attribute. Again this is based on Discoruse's conventions. (If you write your endpoints in our conventional way, you have to add zero client side code to handle this update.)

Result Sets

To find more than one of a thing, you can call this.store.findAll('pet'). This will make a GET to /pets.json and instantiate records for each Pet. You can also call this.store.find('pet', {dog: true}) and it will call /pets.json?dog=true as a filter.

Any time you get back multiple records from the store, it will look like a array, but it's actually a ResultSet. For almost all your code the difference doesn't matter, you can still loop through it and use all the Ember array functions. However, it has some added functionality to make our lives easier.

One thing we do a LOT is loading more data with scrolling. We used to have to code this over and over, so I made a common API for it. If a JSON result includes total_rows_pets and load_more_pets (the later is a URL to load more), the ResultSet will remember those attributes.

You can then just call model.loadMore() to load more results and it will call the remote URL and fetch more records. This means you have to write a lot less code.

RestModel States

We have a lot of repeated code that handles the cases of whether a model is currently saving. You'll see a lot of code that sets a saving property while a promise is resolving, then updating it to false when it finishes. With RestModel this is done automatically. While you are making the above update call, it will automatically set isSaving to true on the model. So if your template looks for that, it will be true while saving and false when it isn't. This should cut out a LOT of code for us.

Creating and Destroying Records

If you want to make a new instance of something that's easy:

const pet = this.store.createRecord('pet', {name: 'woofie'});

At that point, it will have isNew set to true. You can bind it to a form or do whatever you need to input data for the new model. When you are ready to save it, just call pet.save() and it will be sent across the wire. When a record is created, it makes a POST to /pets with the data, just like our conventions.

To destroy a record, just call pet.destroyRecord() and you're good to go. It will make a DELETE to /pets/:pet_id.

Loading Sideloaded Objects

Often you want to return a list of items that include associated data. For example our QueuedPostSerializer embeds a user and a topic. By default, ActiveModel::Serializers will sideload this data, which means that instead of every queued_post in the json having an embedded user and topic property, it will have a user_id and topic_id, and then separate users and topics collections on the root of the JSON that contains those objects. This can cut down on the JSON size quite a bit, but is difficult to instantiate on the client side.

With the new store code, there is a way to do this automatically! When serializing, add the rest_serializer: true option:

render_serialized(@queued_posts, QueuedPostSerializer, root: :queued_posts, rest_serializer: true)

If you do this, this.store.find('queued-posts') will automatically load and instantiate the sideloaded data! Any key that begins with something_id will look for a somethings collection in the root and instantiate Something models if they exist.

(As a bonus, I've added it so that if you include category_id anywhere in a rest_serializer: true dump, the category will automatically be found. We always have the categories loaded client side so there is no need to serialize anything but the id).

Identity Map

Anything found via the store will use an identity map. So if you retrieve the same user by id twice, you are guaranteed to be pointing at the same instance in memory. Updating it in one place will update it everywhere that it is bound. Note this is true even if the user comes back in a collection or side loaded as explained above.

Munging Data

Sometimes the data that comes back from the server isn't right for you. I'd highly suggest trying to use the rest_serializer: true option but if that can't work for you, you can just implement the munge() method. For example:

const Pet = RestModel.extend();

Pet.reopenClass({
  munge(json) {
     // weight comes back as lbs but we want kgs
     json.weight = json.weight * 0.453592;
     return json;
  }
});

If a munge method is present JSON retrieved from the server will be passed through it before instantiated so you can modify it. Again, try not to do this unless dealing with old models or code.

Adapters

What if your JSON endpoints don't follow our RESTful conventions? You should definitely try to make everything follow the discourse conventions, but if you can't do that there is a way to modify where data is sent/retrieved.

If you define an adapter in discourse/adapters, it will be used to contact the server instead of the default REST method. For example, I implemented one of these for topic-list because it uses the PreloadStore to fetch data quickly. It will first look for the model in the PreloadStore and if it doesn't exist will use a custom finder.

Adapters are useful for when you don't control the JSON endpoint or the JSON endpoint doesn't work with our conventions. Most of the time going forward you shouldn't need to use them, but they are there if you need to do something different.

Conclusion

I've been using this store and RestModel in the last few features I've written and it has really made a huge difference in the amount of code I've written. The API is pretty good now, but I would love suggestions/tweaks if people have them.

Posts: 1

Participants: 1

Read full topic


Clean up uploads job failing

$
0
0

@frederic wrote:

Hello,

I'm puzzled : I think my config is ok :

but the orphans uploads are not deleted, after a two or three days wait : my backup files are still large, whereas I changed all links from internal to external storage. So they are probably not deleted

How can I know more about the purge process ?

The alternative way is to enter my instance, and delete the uploaded files manualy, but there is probably a better way.

Many thanks for your help !

Posts: 1

Participants: 1

Read full topic

Top Referred Topics (Last 30 Days)

$
0
0

@mak23 wrote:

Hi there, on my admin page i have 4 a top referred topics but no Top referrers confused does this make sense? what and how does a topic classified as a top referred topic..

Posts: 4

Participants: 3

Read full topic

Erratic behaviour when clicking an attachment link

$
0
0

@georgiano wrote:

These bugs are probably related.
My config requires users to be logged on to download attachments.

I have several attachments in one post.

Firefox
1. When logged off user first time clicks attachment, popup window appears saying login is required. Any consecutive clicks on the same attachment does nothing.
2. Clicking another attachment renders empty page.

If there is only one attachment in post then see fact 1
After reloading page same behaviour happens.

Internet explorer
Clicking any attachment always shows 404 error page.

access.log
GET requests on attachments return 404.

Posts: 2

Participants: 2

Read full topic

How about a custom 404?

Installing on cPanel based host

$
0
0

@anthonyalvarez wrote:

Thank you for this great software.
Can Discourse be installed on a host running cPanel?
Ruby and rails have been installed to the server.
The versions are as follows:

[root@host2 ~]# ruby --version
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]

[root@host2 ~]# gem list --local | grep -i rails
rails (2.3.18, 2.3.14)

What is best practice to install an open source ruby app: use cPanel ruby on rail interface or SSH?
Any clues appreciated.

Posts: 3

Participants: 3

Read full topic

Viewing all 60707 articles
Browse latest View live




Latest Images