Topic List Previews (legacy)

Yes, the thumbnails have for a while now been generated by core Discourse so long as you have the correct meta in the Theme Component or Plugin. Both versions of TLP have this meta. The plugin no longer does the actual generation anymore.

However, if you’ve only just upgraded to a recent version of Discourse that supports native thumbnail production you will need to rebake your older Topics as the data is stored differently.

New Topics should not be an issue.

However please note that thumbnails are only generated for images uploaded to your Discourse but this includes most onebox previews. You can host your uploads on S3 storage if you wish. That’s all core behaviour now. Hotlinking is no longer supported.

Also please check you have no errors in the JavaScript console that might be breaking the front end customisations and preventing the thumbnails from showing.

2 Likes

Thank you for the response and clarifications. I’m going to look a little further into a JS error that we do have to see if it might be causing a problem, but I wanted to respond with an example of it not pulling youtube or vimeo thumbnails, in case you can think of something else simple that I’m missing:

Each of these is a new topic created after my last update:

image

Here’s the youtube one just to show you that it did unfold correctly in the topic itself:

If there’s nothing obvious missing, and my JS error ends up being unrelated, are you available in the next few days for some paid debugging work? (we can take that conversation to a PM).

2 Likes

PM me those links and I’ll try them out on my instance.

NB I don’t maintain the logic that does the thumb-nailing work now, that’s core discourse.

1 Like

Hello. Thanks for making this wonderful plugin! It helped our forum look much better, and I really appreciate your hard work. However, I think I might have found a minor bug: It seems that after the plugin is enabled, the tag list for topics would stay in a single line, even if the list is very long(about 20 tags). As a result, the topic list display would become very wide. When the plugin is disabled, discourse’s default behavior is to display tags using multiple lines if there are many tags. Because of this, maybe the behavior in the plugin is a small bug? It makes category pages look really strange when many tags are used. Would it be possible to fix this behavior so that many tags can be displayed normally?

3 Likes

Hi Alan, and thanks for your compliments.

20 tags?! That’s an unusually high number and definitely an edge case that I would not normally have expected. You can probably fix it with CSS, have you experimented?

1 Like

Thank you for making this plugin, it really does help many forums look much more aesthetically pleasing.
My forum especially likes to to link to tweets (Twitter) a lot, however there are no previews that show up for it at all. Since a random BBC article does have a preview, I wonder why a website like Twitter does not? Is this how the plugin was intended to work?

1 Like

This plugin no longer creates the thumbnails itself. That is down to core now (seeing how popular this functionality was, Discourse went ahead and built part of it in core).

The thumbnail making code is opinionated. Not all previews make the grade (eg too small). Perhaps you can share a specific example and we can take a deeper look. Might need to escalate it to the Discourse team.

1 Like

This plugin is broken after the yesterdays last update…
Best regards

3 Likes

Please don’t update outside of the supported period. (the first five days of the month, as per our policy outlined in the OP). If you do so, we advise you test out the upgrade in a non-Production environment first.

3 Likes

That said, on this occasion, I’ve pushed a fix for both the plugin and the TC :).

TC: https://github.com/merefield/discourse-topic-list-previews-theme/commit/7a2f5399fb9387507aeeb221b48aeb99a3ed51b9

Plugin: https://github.com/paviliondev/discourse-topic-previews/pull/160

They should both now work on latest tests-passed.

2 Likes

Thanks @merefield for fixing this. I was just about to report it. I did rebuild last night and then all the posts on my site were unviewable. I then had to disable unofficial plugins and found that not just TLP, but other plugins are also suffering from this.

Please also check these plugins as they may have the same issue. Only after disabling these can I see my posts again:

https://github.com/paviliondev/discourse-news
https://github.com/paviliondev/discourse-ratings
https://github.com/paviliondev/discourse-layouts

1 Like

It is out of our support period currently, but the primary maintainers of those will take a look at the minimum when the support period comes back around again.

Please resist the temptation to rebuild Production so often. Just because you can, doesn’t mean you should :slight_smile:

4 Likes

I shall try to resist. :innocent:

2 Likes

And if you must fiddle with your build, do so in a staging environment. Heck building one of those might keep you too busy to upgrade Prod ;).

4 Likes

I have no functional problems with this plugin. I can see the topic list thumbnails working just fine. However, I saw this in my log today (It’s the only error in my log), so I thought I would report it. I think this is a conflict with the “Solved” plugin. You can reproduce it if you have both of these plugins. If you try to create a topic and pick the solution, you may get a 500 error.

Log
plugins/discourse-topic-previews/plugin.rb:61:in `block (2 levels) in activate!'
lib/discourse_event.rb:14:in `block in trigger'
/usr/local/lib/ruby/2.6.0/set.rb:338:in `each_key'
/usr/local/lib/ruby/2.6.0/set.rb:338:in `each'
lib/discourse_event.rb:13:in `trigger'
plugins/discourse-solved/plugin.rb:160:in `block in accept_answer!'
lib/distributed_mutex.rb:33:in `block in synchronize'
lib/distributed_mutex.rb:29:in `synchronize'
lib/distributed_mutex.rb:29:in `synchronize'
lib/distributed_mutex.rb:14:in `synchronize'
plugins/discourse-solved/plugin.rb:81:in `accept_answer!'
plugins/discourse-solved/plugin.rb:222:in `accept'
actionpack (6.0.3.2) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (6.0.3.2) lib/abstract_controller/base.rb:195:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:112:in `block in run_callbacks'
app/controllers/application_controller.rb:340:in `block in with_resolved_locale'
i18n (1.8.5) lib/i18n.rb:313:in `with_locale'
app/controllers/application_controller.rb:340:in `with_resolved_locale'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:121:in `block in run_callbacks'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:139:in `run_callbacks'
actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `block in instrument'
activesupport (6.0.3.2) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `instrument'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (6.0.3.2) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.0.3.2) lib/abstract_controller/base.rb:136:in `process'
actionview (6.0.3.2) lib/action_view/rendering.rb:39:in `process'
rack-mini-profiler (2.0.4) lib/mini_profiler/profiling_methods.rb:104:in `block in profile_method'
actionpack (6.0.3.2) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (6.0.3.2) lib/action_controller/metal.rb:254:in `dispatch'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:834:in `call'
railties (6.0.3.2) lib/rails/engine.rb:527:in `call'
railties (6.0.3.2) lib/rails/railtie.rb:190:in `public_send'
railties (6.0.3.2) lib/rails/railtie.rb:190:in `method_missing'
actionpack (6.0.3.2) lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
actionpack (6.0.3.2) lib/action_dispatch/routing/mapper.rb:48:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:834:in `call'
lib/middleware/omniauth_bypass_middleware.rb:68:in `call'
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:40:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:336:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/cookies.rb:648:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
logster (2.9.2) lib/logster/middleware/reporter.rb:43:in `call'
railties (6.0.3.2) lib/rails/rack/logger.rb:37:in `call_app'
railties (6.0.3.2) lib/rails/rack/logger.rb:28:in `call'
config/initializers/100-quiet_logger.rb:19:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/request_id.rb:27:in `call'
lib/middleware/enforce_hostname.rb:22:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/host_authorization.rb:76:in `call'
rack-mini-profiler (2.0.4) lib/mini_profiler/profiler.rb:321:in `call'
message_bus (3.3.1) lib/message_bus/rack/middleware.rb:61:in `call'
lib/middleware/request_tracker.rb:176:in `call'
railties (6.0.3.2) lib/rails/engine.rb:527:in `call'
railties (6.0.3.2) lib/rails/railtie.rb:190:in `public_send'
railties (6.0.3.2) lib/rails/railtie.rb:190:in `method_missing'
rack (2.2.3) lib/rack/urlmap.rb:74:in `block in call'
rack (2.2.3) lib/rack/urlmap.rb:58:in `each'
rack (2.2.3) lib/rack/urlmap.rb:58:in `call'
unicorn (5.6.0) lib/unicorn/http_server.rb:632:in `process_client'
unicorn (5.6.0) lib/unicorn/http_server.rb:728:in `worker_loop'
unicorn (5.6.0) lib/unicorn/http_server.rb:548:in `spawn_missing_workers'
unicorn (5.6.0) lib/unicorn/http_server.rb:144:in `start'
unicorn (5.6.0) bin/unicorn:128:in `<top (required)>'
vendor/bundle/ruby/2.6.0/bin/unicorn:23:in `load'
vendor/bundle/ruby/2.6.0/bin/unicorn:23:in `<main>'
2 Likes

Steps to reproduce please. I have two sites running this and no such log entries.

1 Like

To reproduce on my site:

  1. Have Topic List Previews enabled.
  2. Go to a topic where Solved is enabled:
    image
  3. As an admin or staff, go to someone’s post and select it as a Solution.
2 Likes

Thanks. I’ll take a look during support week.

1 Like

@merefield I love your topic list preview theme component together with the sidecar plugin for likes and bookmarks.

https://github.com/merefield/discourse-topic-list-previews-theme/

I believe, I found a bug in the Topic List Preview List when someone clicks the “Replies”.

Ideal situation:

Click the replies for the topic in the topic preview list, you get to select the Dates and you choose one and it takes you to the topic details.

My problem:

Click the replies for the topic in the topic preview list, I see the Dates selection, but before I chose one, Topic List Preview page refreshes and it doesn’t take you to the Topic details.

image

When you get a chance, please verify this.

Thank you.

2 Likes

I’ve spent a lot of time during the month on support this month. Given this is not critical I’ll defer it to a more quieter period. Thanks for your understanding. My recollection is that this is an old bug the fix for which was never prioritised. PR welcome as ever.

3 Likes