[ARCHIVE] Topic List Previews


(Angus McLeod) #750

I could be wrong, but I don’t think there’s any way to do this. Template overrides are applied by core Discourse according to namespace, not by any logic in the plugin itself.

The ‘disabled’ setting is just a setting you can apply within plugin logic to prevent it from running. I don’t (think) it can be used to prevent a plugin template overrides being picked up by core Discourse.

Actually, I kept this plugin free of template overrides for as long as possible for this reason, but the jQuery got a bit convoluted and I had to override the topic-list-item template itself.


(Joe) #751

I completely understand :ok_hand:

I figured it would be something like that. I just thought it would be good to bring it up for future reference because I ran into it.

Keep up the awesome work! :wine_glass:


(Stephen Chung) #752

FYI…

A display problem caused by this plugin.


(Anil Gupta) #753

Hi @angus,

We see this error originating from topic list previews plugin:

FULL backtrace:

/var/www/discourse/plugins/discourse-topic-previews/plugin.rb:220:in `block in update_post_image'
/var/www/discourse/plugins/discourse-topic-previews/plugin.rb:219:in `reject'
/var/www/discourse/plugins/discourse-topic-previews/plugin.rb:219:in `update_post_image'
/var/www/discourse/lib/cooked_post_processor.rb:38:in `block in post_process'
/var/www/discourse/lib/distributed_mutex.rb:21:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:5:in `synchronize'
/var/www/discourse/lib/cooked_post_processor.rb:32:in `post_process'
/var/www/discourse/app/jobs/regular/process_post.rb:24:in `execute'
/var/www/discourse/app/jobs/base.rb:134:in `block (2 levels) in perform'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:63:in `with_connection'
/var/www/discourse/app/jobs/base.rb:129:in `block in perform'
/var/www/discourse/app/jobs/base.rb:125:in `each'
/var/www/discourse/app/jobs/base.rb:125:in `perform'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:188:in `execute_job'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:170:in `block (2 levels) in process'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/middleware/chain.rb:128:in `block in invoke'
/var/www/discourse/lib/sidekiq/pausable.rb:80:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/middleware/chain.rb:133:in `invoke'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:169:in `block in process'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:141:in `block (6 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/job_retry.rb:97:in `local'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:140:in `block (5 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq.rb:36:in `block in <module:Sidekiq>'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:136:in `block (4 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:204:in `stats'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:131:in `block (3 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/job_logger.rb:7:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:130:in `block (2 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/job_retry.rb:72:in `global'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:129:in `block in dispatch'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/logging.rb:44:in `with_context'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/logging.rb:38:in `with_job_hash_context'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:128:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:168:in `process'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:85:in `process_one'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:73:in `run'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/util.rb:16:in `watchdog'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/util.rb:25:in `block in safe_thread'

Any idea how can we resolve this error?


(Colin Marshall) #754

On my test install I am getting favicon previews. The plugin was cloned/installed two days ago. Looks like the Jim Carrey topic in your sandbox also shows a favicon preview, but maybe that’s just because you didn’t rebuild the html?

Thanks!


(Angus McLeod) #755

Thanks, fixed: Remove unnecessary rules · angusmcleod/discourse-topic-previews@6b4f401 · GitHub

Thanks, that should be fixed now too:

hm, yeah when I rebuild the html on that post it works.

But there may still be an issue given that you just installed…

Does the right image (or no image if there are no preview-able images in that post) get picked up when you rebuild the html?

What happens if there are other, pre-viewable, images in the same post?


Highlighted user on topic list aligned incorrectly
(Anil Gupta) #756

Thanks for quick fix and response.


(Anil Gupta) #757

Hi @angus

I do not see the same error again but something with the CSS formatting has messed up:

image

Instead of horizontal stacking, the icons are not vertically stacked.
Is it possible to fix them?


(Angus McLeod) #758

My apologies. Please update again: posters wrap when a category is present · angusmcleod/discourse-topic-previews@c4a7c32 · GitHub


(Anil Gupta) #759

Thanks. This update fixed the issue.

I would like to ask one more thing.
I see a small horizontal gray line on top of each page. If we click on it, it takes us to ‘tags’ page.

I am not sure if this is due to this plugin or something else. But, I am seeing it since the day we installed this ‘Topic list Preview’ plugin.


image

You can verify it here:

It is a link to TAGS URL: TruVisa - Immigration visa questions, reliable answers

But, it does not show any text whatsoever.

Any idea if this is related to this plugin?


(Angus McLeod) #760

It’s an issue, but it’s only an issue if you enable “Featured Images” but then don’t assign a featured images tag. So it’s an edge case that shouldn’t really affect you.

You can fix it on your end by disabling featured images, as you’re not using that feature. This setting should be off.

Featured images are images that appear above the topic list and are identified by tag. They are different from topic list thumbnails.

**edit: I’ve also handled the edge case itself: Featured images enabled but no featured tag assigned edge case · angusmcleod/discourse-topic-previews@517a7e1 · GitHub


(Anil Gupta) #761

Thanks for the detailed response.

Is there any documentation which can help with 'how to assign a featured image tag’?

I am not sure what exactly has to be done to display the images.
Do i have to add code to custom theme in HTML area?


(Colin Marshall) #762

Rebuilding the html actually worked when I tried it again. Not sure why it wasn’t working before when I was having the issue, but that’s ok because it’s good now. Thanks!!!


(Angus McLeod) #763

Featured images are all controlled by settings added by this plugin, e.g. the featured image tag is set by the featured image tag setting.

Let me know if you have any trouble with any particular setting.


(Anil Gupta) #764

Looks good. Thanks for the explanation. I appreciate it.


Problem with https with favicon in onebox
Problem with https with favicon in onebox
(Andreas Dorfer) #765

I tried this about 14 hours ago and started a full rebake (which finisched successfully meanwhile)

grafik

But no change, even after multiple Reloads:

Any hints? (it get the “green padlock” back if i disable this plugin)


(Angus McLeod) #766

This is not a TLP issue. I’ve addressed it here:


(Sora &\) #767

Now, thumbnail only show if image is posted in content topic. If photo is in comment, this photo can’t load become thumbnail for that topic. My question is how can we put photo in comment, But thumbnail still show homepage, thank you!


#768

Maybe have the plugin scan the topic from the first post onwards until it finds a picture?


(J C) #769

Does anyone have working demos that I can test?