Discourse Category Headers theme component

Those tags are part of the category description. I can try to put a html-safe on it, but I’m not sure if this will introduce vulnerabilities?

What is the error in the console with this blank page? Is it the one posted above?

Apologies, could you elaborate a little more on this? Thanks!

@NateDhaliwal I’m not sure! I’m sorry, I have no idea what these errors correspond to or how to find the one that directly relates to that page.

Did you take a look at how other components handle that?
I’d assume it’s save. At least I have the impression the official category banner component uses html-safe without any separate escaping too

2 likes

FWIW This one appears to be an issue with something trying to use the old route rather than the new /admin/config/user-fields.json one.

It also has a mention of:

So maybe @RGJ may know more? :crossed_fingers:

1 like

TL;DR no. :slight_smile:

Long version:

This is an internal plugin that we use on our hosting (similar to CDCK “hosted site”) that adds some extra features that we need to host the site. This specific line replaces the multisite “not found” with a more verbose error message which indicates that the owner of the site has probably misconfigured their DNS.

Since it patches the multisite middleware, every request on every site we host goes through it. If you see this plugin in a stack trace, and the line lib/middleware/enforce_hostname.rb is immediately above it, it is a normal call and not a cause of the issue.

3 likes

Zit je op de stabiele branch? Misschien heeft de update ervoor gezorgd dat de plugin kapot is op stable. Dan kan het helpen als er een vermelding wordt toegevoegd aan het compatibiliteitsbestand.

2 likes

@Moin Ik weet het niet, hoe kan ik controleren op welke branch ik zit?

1 like

Ja, je bent op de stabiele versie @jackierenee.

En het lijkt inderdaad op wat Moin zei, de thema-component is bijgewerkt, maar er was geen compatibiliteitsvastzetting. @Rhidian @NateDhaliwal

5 likes

Bedankt voor de bevestiging @RGJ

Dus, moet ik gewoon wachten op de compatibiliteits-pin voordat ik dit onderdeel weer aan onze site toevoeg?

Ik werk aan een PR die dit probleem hopelijk zal oplossen.

3 likes

Yes :+1:

1 like

Sure.

Without the Theme Component, the text in the category description is --font-up-3 by default. This is via the .category-heading class. I think that this has grown in recent times.

With the Theme Component, the text in the category description is --font-0. This can be bumped up to --font-up-1(larger) or font-up-2(largest). Neither of these achieve the new normal!

1 like

Oké, dus is dit goed?
kleiner → --font-up-2
normaal → --font-up-3
groter → --font-up-4
grootst → --font-up-5
Cc: @Rhidian

1 like

Hallo @jackierenee, ik heb een PR samengevoegd. Zou je kunnen proberen te updaten en te zien of het werkt?

1 like

Hi @NateDhaliwal I just tried updating and added the component back to my site. Category pages are still blank.

And if I try to use it in combination with the minimal category boxes, I get a blank homepage also.

Maybe I’m doing something wrong, but I don’t know how to solve it.

I also got an error at the top of my site now:

Nog een ding, ik denk dat dit het foutenlogboek is dat verband houdt met dat foutbericht:

Message (4472 copies reported)

[db6814] ActionController::RoutingError (No route matches [GET] "/admin/customize/user_fields.json")
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/processing_request.rb:12:in `call'
lib/middleware/request_tracker.rb:385:in `call'


Backtrace

actionpack (7.2.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:35:in `call'
actionpack (7.2.2.1) lib/action_dispatch/middleware/show_exceptions.rb:32:in `call'
logster (2.20.0) lib/logster/middleware/reporter.rb:40:in `call'
railties (7.2.2.1) lib/rails/rack/logger.rb:41:in `call_app'
railties (7.2.2.1) lib/rails/rack/logger.rb:29:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
actionpack (7.2.2.1) lib/action_dispatch/middleware/request_id.rb:33:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
plugins/z-communiteq-features/plugin.rb:142:in `call'
rack (2.2.10) lib/rack/method_override.rb:24:in `call'
rack (2.2.10) lib/rack/sendfile.rb:110:in `call'
rack-mini-profiler (3.3.1) lib/mini_profiler.rb:191:in `call'
lib/middleware/processing_request.rb:12:in `call'
message_bus (4.3.8) lib/message_bus/rack/middleware.rb:60:in `call'
lib/middleware/request_tracker.rb:385:in `call'
actionpack (7.2.2.1) lib/action_dispatch/middleware/remote_ip.rb:96:in `call'
rails_multisite (6.1.0) lib/rails_multisite/middleware.rb:26:in `call'
plugins/z-communiteq-features/plugin.rb:168:in `call'
railties (7.2.2.1) lib/rails/engine.rb:535:in `call'
railties (7.2.2.1) lib/rails/railtie.rb:226:in `public_send'
railties (7.2.2.1) lib/rails/railtie.rb:226:in `method_missing'
rack (2.2.10) lib/rack/urlmap.rb:74:in `block in call'
rack (2.2.10) lib/rack/urlmap.rb:58:in `each'
rack (2.2.10) lib/rack/urlmap.rb:58:in `call'
unicorn (6.1.0) lib/unicorn/http_server.rb:634:in `process_client'
unicorn (6.1.0) lib/unicorn/http_server.rb:739:in `worker_loop'
unicorn (6.1.0) lib/unicorn/http_server.rb:547:in `spawn_missing_workers'
unicorn (6.1.0) lib/unicorn/http_server.rb:143:in `start'
unicorn (6.1.0) bin/unicorn:128:in `<top (required)>'
vendor/bundle/ruby/3.3.0/bin/unicorn:25:in `load'
vendor/bundle/ruby/3.3.0/bin/unicorn:25:in `<main>'

Env

HTTP HOSTS: community.eaie.org

Bedankt!

Zijn er fouten in de browserconsole?
Kunt u uw Discourse-versie delen waarop u momenteel werkt? Dit staat op de /admin-pagina.
Bedankt!

Hi @NateDhaliwal, sorry, I don’t know what errors in the browser console means exactly.

I believe this is the version of discourse that I’m running: Discourse 3.4.6 - GitHub - discourse/discourse: A platform for community discussion. Free, open, simple. version 3d149ba8244585f4bcb41db77aa8825e72468bdb

Hi @NateDhaliwal sorry, I was able to figure it out, here are some of the errors:

Discourse v3.4.6 — https://github.com/discourse/discourse/commits/3d149ba824 — Ember v5.12.0
category-header.gjs:51 Uncaught TypeError: Cannot read properties of undefined (reading 'mobileView')
    at get showHeader (category-header.gjs:51:61)
    at eE (index.js:78:1)
    at index.js:78:1
    at index.js:78:1
    at X (index.js:78:1)
    at T (index.js:78:1)
    at index.js:78:1
    at index.js:78:1
    at X (index.js:78:1)
    at T (index.js:78:1)
    at Object.evaluate (index.js:78:1)
    at Object.evaluate (index.js:78:1)
    at tV.evaluateSyscall (index.js:78:1)
    at tV.evaluateInner (index.js:78:1)
    at tV.evaluateOuter (index.js:78:1)
    at t1.next (index.js:78:1)
    at t1._execute (index.js:78:1)
    at t1.execute (index.js:78:1)
    at t2.sync (index.js:78:1)
    at t6.render (index.js:78:1)
    at index.js:78:1
    at tx (index.js:78:1)
    at io._renderRoots (index.js:78:1)
    at io._renderRootsTransaction (index.js:78:1)
    at io._revalidate (index.js:78:1)
    at invoke (index.js:78:1)
    at m.flush (index.js:78:1)
    at g.flush (index.js:78:1)
    at V._end (index.js:78:1)
    at V.end (index.js:78:1)
    at V._run (index.js:78:1)
    at V.run (index.js:78:1)
    at d (deprecate.js:100:1)
    at Object.success (video-placeholder.js:39:1)
    at l (jquery.js:10:1)
    at Object.fireWith [as resolveWith] (jquery.js:10:1)
    at C (jquery.js:10:1)
    at XMLHttpRequest.<anonymous> (jquery.js:10:1)Understand this error
category-header.gjs:51 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'mobileView')
    at get showHeader (category-header.gjs:51:61)
    at eE (index.js:78:1)
    at index.js:78:1
    at index.js:78:1
    at X (index.js:78:1)
    at T (index.js:78:1)
    at index.js:78:1
    at index.js:78:1
    at X (index.js:78:1)
    at T (index.js:78:1)
    at Object.evaluate (index.js:78:1)
    at Object.evaluate (index.js:78:1)
    at tV.evaluateSyscall (index.js:78:1)
    at tV.evaluateInner (index.js:78:1)
    at tV.evaluateOuter (index.js:78:1)
    at t1.next (index.js:78:1)
    at t1._execute (index.js:78:1)
    at t1.execute (index.js:78:1)
    at t2.sync (index.js:78:1)
    at t6.render (index.js:78:1)
    at index.js:78:1
    at tx (index.js:78:1)
    at io._renderRoots (index.js:78:1)
    at io._renderRootsTransaction (index.js:78:1)
    at io._renderRoot (index.js:78:1)
    at io._appendDefinition (index.js:78:1)
    at io.appendOutletView (index.js:78:1)
    at invoke (index.js:78:1)
    at m.flush (index.js:78:1)
    at g.flush (index.js:78:1)
    at V._end (index.js:78:1)
    at index.js:78:1Understand this error
category-header.gjs:51 Uncaught TypeError: Cannot read properties of undefined (reading 'mobileView')
    at get showHeader (category-header.gjs:51:61)
    at eE (index.js:78:1)
    at index.js:78:1
    at index.js:78:1
    at X (index.js:78:1)
    at T (index.js:78:1)
    at index.js:78:1
    at index.js:78:1
    at X (index.js:78:1)
    at T (index.js:78:1)
    at Object.evaluate (index.js:78:1)
    at Object.evaluate (index.js:78:1)
    at tV.evaluateSyscall (index.js:78:1)
    at tV.evaluateInner (index.js:78:1)
    at tV.evaluateOuter (index.js:78:1)
    at t1.next (index.js:78:1)
    at t1._execute (index.js:78:1)
    at t1.execute (index.js:78:1)
    at t2.sync (index.js:78:1)
    at t6.render (index.js:78:1)
    at index.js:78:1
    at tx (index.js:78:1)
    at io._renderRoots (index.js:78:1)
    at io._renderRootsTransaction (index.js:78:1)
    at io._revalidate (index.js:78:1)
    at invoke (index.js:78:1)
    at m.flush (index.js:78:1)
    at g.flush (index.js:78:1)
    at V._end (index.js:78:1)
    at V.end (index.js:78:1)
    at V._runExpiredTimers (index.js:78:1)Understand this error
category-header.gjs:51 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'mobileView')
    at get showHeader (category-header.gjs:51:61)
    at eE (index.js:78:1)
    at index.js:78:1
    at index.js:78:1
    at X (index.js:78:1)
    at T (index.js:78:1)
    at index.js:78:1
    at index.js:78:1
    at X (index.js:78:1)
    at T (index.js:78:1)
    at Object.evaluate (index.js:78:1)
    at Object.evaluate (index.js:78:1)
    at tV.evaluateSyscall (index.js:78:1)
    at tV.evaluateInner (index.js:78:1)
    at tV.evaluateOuter (index.js:78:1)
    at t1.next (index.js:78:1)
    at t1._execute (index.js:78:1)
    at t1.execute (index.js:78:1)
    at t2.sync (index.js:78:1)
    at t6.render (index.js:78:1)
    at index.js:78:1
    at tx (index.js:78:1)
    at io._renderRoots (index.js:78:1)
    at io._renderRootsTransaction (index.js:78:1)
    at io._revalidate (index.js:78:1)
    at invoke (index.js:78:1)
    at m.flush (index.js:78:1)
    at g.flush (index.js:78:1)
    at V._end (index.js:78:1)
    at index.js:78:1Understand this error
1 like

That is very odd. It’s strange that this error is appearing now, as this.site.mobileView was in the original version :thinking:. I cannot repo this with latest tests-passed, could this be a limitation of stable (though, it seems unlikely - core uses this as well).