Topic List Previews


(Angus McLeod) #913

Good idea. I’ve made that change.

You mean a site setting (as opposed to a user setting) right? I’ve added site settings for minimum width and height for “previewable” images.

topic_list_previewable_image_width_min and
topic_list_previewable_image_height_min


(Angus McLeod) #914

@sinister89 Give this a whirl


(Stephen Chung) #915

OK, it seems to work almost perfectly!

The only problem is that it seems to be using the display dimensions of the image as filter. Some email programs or company email systems blow up an icon to large sizes (like 320x240), probably just to defeat such a thing! The actual image is small (like 96x96), but it gets blown up to a large size.

It would be probably a good idea to use the “raw” dimensions of the image instead of the display dimensions. Other than this, works perfectly!!!

:+1:


(Shashank Singla) #916

Thanks @angus. Works exactly as I wanted.

Rally appreciate all the work you are doing!

BTW, a minor thing which I am not sure is a bug or not but in case when the topic does not have any post the topic list excerpt length is not being used to shorten the preview resulting in cut off.


#917

I think we have some kind of bug that is breaking the main code’s functionality.

I have a tag called ‘featured’ and its causing a Server Error 500 when clicked on, but only when it’s included in the Topic List Previews scope using topic list featured images tag . It’s populated with several posts. When I remove it from scope of TLP, the error goes away.

I tried this with another tag, and the same thing happened … so looks as if there is an issue with the way TLP is manipulating the tags when in-scope which breaks something in the parent code? At least on my Production install … trying to reproduce on dev …

:(

Server Error

while trying to load [/tags/featured/l/latest.json?order=default&ascending=false&filter=tags/featured/l/latest](https://www.example.com/tags/featured/l/latest.json?order=default&ascending=false&filter=tags/featured/l/latest)

Error code: 500 error

(Angus McLeod) #918

hm, I’ll take a look at this soon.

@merefield Can you find the error’s stack trace in /logs?


#919

Log output below - “created_at” is ambiguous?

Recent
Message (7 copies reported)

ActiveRecord::StatementInvalid (PG::AmbiguousColumn: ERROR:  column reference "created_at" is ambiguous
LINE 10: ...ned_at OR tu.cleared_pinned_at IS NULL)) ORDER BY created_at...
                                                              ^
: SELECT  "topics"."id" AS t0_r0, "topics"."title" AS t0_r1, "topics"."last_posted_at" AS t0_r2, "topics"."created_at" AS t0_r3, "topics"."updated_at" AS t0_r4, "topics"."views" AS t0_r5, "topics"."posts_count" AS t0_r6, "topics"."user_id" AS t0_r7, "topics"."last_post_user_id" AS t0_r8, "topics"."reply_count" AS t0_r9, "topics"."featured_user1_id" AS t0_r10, "topics"."featured_user2_id" AS t0_r11, "topics"."featured_user3_id" AS t0_r12, "topics"."avg_time" AS t0_r13, "topics"."deleted_at" AS t0_r14, "topics"."highest_post_number" AS t0_r15, "topics"."image_url" AS t0_r16, "topics"."like_count" AS t0_r17, "topics"."incoming_link_count" AS t0_r18, "topics"."category_id" AS t0_r19, "topics"."visible" AS t0_r20, "topics"."moderator_posts_count" AS t0_r21, "topics"."closed" AS t0_r22, "topics"."archived" AS t0_r23, "topics"."bumped_at" AS t0_r24, "topics"."has_summary" AS t0_r25, "topics"."archetype" AS t0_r26, "topics"."featured_user4_id" AS t0_r27, "topics"."notify_moderators_count" AS t0_r28, "topics"."spam_count" AS t0_r29, "topics"."pinned_at" AS t0_r30, "topics"."score" AS t0_r31, "topics"."subtype" AS t0_r32, "topics"."slug" AS t0_r33, "topics"."deleted_by_id" AS t0_r34, "topics"."participant_count" AS t0_r35, "topics"."word_count" AS t0_r36, "topics"."excerpt" AS t0_r37, "topics"."pinned_globally" AS t0_r38, "topics"."pinned_until" AS t0_r39, "topics"."fancy_title" AS t0_r40, "topics"."highest_staff_post_number" AS t0_r41, "topics"."featured_link" AS t0_r42, "categories"."id" AS t1_r0, "categories"."name" AS t1_r1, "categories"."color" AS t1_r2, "categories"."topic_id" AS t1_r3, "categories"."topic_count" AS t1_r4, "categories"."created_at" AS t1_r5, "categories"."updated_at" AS t1_r6, "categories"."user_id" AS t1_r7, "categories"."topics_year" AS t1_r8, "categories"."topics_month" AS t1_r9, "categories"."topics_week" AS t1_r10, "categories"."slug" AS t1_r11, "categories"."description" AS t1_r12, "categories"."text_color" AS t1_r13, "categories"."read_restricted" AS t1_r14, "categories"."auto_close_hours" AS t1_r15, "categories"."post_count" AS t1_r16, "categories"."latest_post_id" AS t1_r17, "categories"."latest_topic_id" AS t1_r18, "categories"."position" AS t1_r19, "categories"."parent_category_id" AS t1_r20, "categories"."posts_year" AS t1_r21, "categories"."posts_month" AS t1_r22, "categories"."posts_week" AS t1_r23, "categories"."email_in" AS t1_r24, "categories"."email_in_allow_strangers" AS t1_r25, "categories"."topics_day" AS t1_r26, "categories"."posts_day" AS t1_r27, "categories"."allow_badges" AS t1_r28, "categories"."name_lower" AS t1_r29, "categories"."auto_close_based_on_last_post" AS t1_r30, "categories"."topic_template" AS t1_r31, "categories"."contains_messages" AS t1_r32, "categories"."sort_order" AS t1_r33, "categories"."sort_ascending" AS t1_r34, "categories"."uploaded_logo_id" AS t1_r35, "categories"."uploaded_background_id" AS t1_r36, "categories"."topic_featured_link_allowed" AS t1_r37, "categories"."all_topics_wiki" AS t1_r38, "categories"."show_subcategory_list" AS t1_r39, "categories"."num_featured_topics" AS t1_r40, "categories"."default_view" AS t1_r41, "categories"."subcategory_list_style" AS t1_r42, "categories"."default_top_period" AS t1_r43, "categories"."mailinglist_mirror" AS t1_r44, "categories"."suppress_from_latest" AS t1_r45, "categories"."minimum_required_tags" AS t1_r46, "categories"."navigate_to_first_post_after_read" AS t1_r47 FROM "topics" LEFT OUTER JOIN "categories" ON "categories"."id" = "topics"."category_id" LEFT OUTER JOIN topic_users AS tu ON (topics.id = tu.topic_id AND tu.user_id = 1) INNER JOIN topic_tags t0 ON t0.topic_id = topics.id AND t0.tag_id = 20 WHERE (topics.archetype <> 'private_message') AND (topics.deleted_at IS NULL) AND (COALESCE(tu.notification_level,1) > 0) AND (
        NOT EXISTS (
          SELECT 1
            FROM category_users cu
           WHERE cu.user_id = 1
             AND cu.category_id = topics.category_id
             AND cu.notification_level = 0
             AND cu.category_id <> -1
             AND (tu.notification_level IS NULL OR tu.notification_level < 2)
        )) AND (pinned_globally AND  pinned_at IS NOT NULL  AND (topics.pinned_at > tu.cleared_pinned_at OR tu.cleared_pinned_at IS NULL)) ORDER BY created_at DESC LIMIT 30)
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/pg.rb:95:in `exec'
Backtrace

/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/pg.rb:95:in `exec'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/pg.rb:95:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:603:in `block (2 levels) in exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:602:in `block in exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:579:in `block (2 levels) in log'
/usr/local/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:578:in `block in log'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:569:in `log'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:601:in `exec_no_cache'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:588:in `execute_and_clear'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:81:in `exec_query'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:465:in `select'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:57:in `select_all'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/query_cache.rb:99:in `block in select_all'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/query_cache.rb:122:in `block in cache_sql'
/usr/local/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/query_cache.rb:108:in `cache_sql'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/query_cache.rb:99:in `select_all'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation.rb:549:in `block (2 levels) in exec_queries'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation/finder_methods.rb:396:in `apply_join_dependency'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation.rb:545:in `block in exec_queries'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation.rb:578:in `skip_query_cache_if_necessary'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation.rb:542:in `exec_queries'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation.rb:414:in `load'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation.rb:200:in `records'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/relation/delegation.rb:41:in `+'
/var/www/discourse/lib/topic_query.rb:333:in `prioritize_pinned_topics'
/var/www/discourse/lib/topic_query.rb:350:in `create_list'
/var/www/discourse/plugins/discourse-topic-previews/lib/featured_topics.rb:23:in `create_list'
/var/www/discourse/lib/topic_query.rb:174:in `list_latest'
/var/www/discourse/app/controllers/tags_controller.rb:77:in `public_send'
/var/www/discourse/app/controllers/tags_controller.rb:77:in `block (2 levels) in <class:TagsController>'
/var/www/discourse/app/controllers/tags_controller.rb:101:in `show'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/abstract_controller/base.rb:194:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/rendering.rb:30:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:132:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/abstract_controller/callbacks.rb:41:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/rescue.rb:22:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:168:in `block in instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:168:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/railties/controller_runtime.rb:24:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/abstract_controller/base.rb:134:in `process'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionview-5.2.0/lib/action_view/rendering.rb:32:in `process'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/mini_profiler/profiling_methods.rb:104:in `block in profile_method'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal.rb:191:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal.rb:252:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:34:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:52:in `block in serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:840:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-protection-2.0.3/lib/rack/protection/frame_options.rb:31:in `call'
/var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:24:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/tempfile_reaper.rb:15:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/conditional_get.rb:25:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/head.rb:12:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
/var/www/discourse/lib/middleware/anonymous_cache.rb:214:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:232:in `context'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:226:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/cookies.rb:670:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:98:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/logster-1.2.9/lib/logster/middleware/reporter.rb:31:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:38:in `call_app'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:28:in `call'
/var/www/discourse/config/initializers/100-quiet_logger.rb:16:in `call'
/var/www/discourse/config/initializers/100-silence_logger.rb:29:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/request_id.rb:27:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/method_override.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/executor.rb:14:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/mini_profiler/profiler.rb:285:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/message_bus-2.1.5/lib/message_bus/rack/middleware.rb:63:in `call'
/var/www/discourse/lib/middleware/request_tracker.rb:180:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/engine.rb:524:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/railtie.rb:190:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/railtie.rb:190:in `method_missing'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/urlmap.rb:68:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:606:in `process_client'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:701:in `worker_loop'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:549:in `spawn_missing_workers'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:142:in `start'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/bin/unicorn:126:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/bin/unicorn:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.5.0/bin/unicorn:23:in `<main>'
Env

hostname	scw-c3e7ac-app
process_id	[22897, 22925, 22910]
application_version	a35f2984e95304377d6797506a23c3ec9901a61e
HTTP_HOST	www.example.com
REQUEST_URI	/tags/featured
REQUEST_METHOD	GET
HTTP_USER_AGENT	Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15
HTTP_ACCEPT	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_REFERER	[https://www.example.com/admin/upgrade, https://www.example.com/c/eateries-cafes-drinking-holes]
HTTP_X_FORWARDED_FOR	1.1.1.1
HTTP_X_REAL_IP	1.1.1.1
username	my username
Solve  Protect Share

(Angus McLeod) #920

Thanks that helps. I’ll fix it tomorrow.


#921

And I guess you already know this but it’s only when topic list featured order is equal to topic :wink:

So I’m guessing the problem statement is in featured_topics.rb here:

if order_type == 'tag'
      "(SELECT created_at FROM topic_tags
        WHERE topic_id = topics.id
        AND tag_id = #{tag_id})
        DESC"
    elsif order_type == 'topic'
      "created_at DESC"
    end

I’ll take responsibility for this one because I asked for that distinction :wink:

Is it just a case of changing this to:

if order_type == 'tag'
      "(SELECT created_at FROM topic_tags
        WHERE topic_id = topics.id
        AND tag_id = #{tag_id})
        DESC"
    elsif order_type == 'topic'
      "topics.created_at DESC"
    end

?

I’ve tested this change on my ropey dev server but not confident enough to submit a PR yet … suffice to say though, it clears the critical error.

Speaking of my ropey server, Angus, do you find TLP works better when running compiled in Docker mode? My dev server is really struggling and many images don’t show. Any way to overcome this … is it impacted by time-outs?


(Angus McLeod) #922

Submit the PR! :slight_smile: Don’t worry if it’s not 100%, or even 50% right. We can work on it together.

I run Discourse undockerized on my macbook pro. If you think timeouts are the issue try changing the topic_list_test_image_url_timeout site setting.

If you want to delve into that a bit more: All preview are tested on the client before being displayed to avoid broken images. That’s where the timeout is applied. Take a look at the testImageUrl function in assets/javascripts/discourse/lib/utilities.


#923

I resolved the image display issue with the help of Jay, details here:

Please see my PR for bug reported beforehand:


(Hakan) #924

I know I bothered you for too many problems.

But finally I have another problem Topic list prev.

My site

The topic images in the subject do not appear after the last update, only the default thumb image appears.


(Tom Ruh) #925

Has the Social-Media-Style option for thumbnails been removed? Is there a work around to allow 100% width, auto height?


(Hakan) #926

Yes, it gives an error, as I mentioned in my message above, I have the same problem


#927

Hello @angus,
Please please consider restructuring html elements within the topic list social “topic-list-item” for easy css styling. Right now its impossible to re-position list items freely with css.

Current structure:
old%20result
tlp%20suggestion2

My suggestion:
new%20result
tlp%20suggestion

Thanks


(Angus McLeod) #929

@merefield Thanks, I’ve merged your PR :+1:

@nothing Try rebuilding the html on a single post. If it makes the thumbnail reappear, rebuild the html for all posts.

@SpaceMonkey The social media style is still there. There are both site-wide and category-specific settings. For example: social - Angus' Sandbox

@nothing Your screenshot cuts off the relevant details about the exceptions. They could be triggered by anything, and could be thrown in any context. If you are actually having an issue with the social style you’ll need to either:

  • Show me an exception that is connected to TLP; or

  • Show me an example of the social style not working.

@googleboy I can see the problem you’re having so I’ve made a tweak to make it easier for you to achieve your goal.


(Hakan) #930

a private message for your site link review or in my previous post.

Problem.


No pictures in topic at the moment Homepage preview

. and 2nd problem. Suggested Topics problem.


#931

Thanks @angus… It’s perfect !


#932

@angus It seems social-footer wasn’t moved outside topic-details in mobile view.
Also, wouldn’t it be possible to have a separate setting for mobile view topic excerpt length


(Angus McLeod) #933

@googleboy I’ve also moved it on mobile

It would be possible to have a shorter length, but not a longer length. What exactly do you have in mind?