Componente de tema de Cabeçalhos de Categorias do Discourse

Essas tags fazem parte da descrição da categoria. Posso tentar aplicar um html-safe, mas não tenho certeza se isso introduzirá vulnerabilidades?

@NateDhaliwal Não tenho certeza! Desculpe, não tenho ideia do que esses erros correspondem ou como encontrar aquele que se relaciona diretamente com essa página.

Você deu uma olhada em como outros componentes lidam com isso?
Eu presumiria que é seguro. Pelo menos tenho a impressão de que o componente oficial de banner de categoria usa html-safe sem nenhum escape separado também

2 curtidas

FWIW, este parece ser um problema com algo que tenta usar a rota antiga em vez da nova rota /admin/config/user-fields.json.

Ele também tem uma menção de:

Então, talvez @RGJ saiba mais? :crossed_fingers:

1 curtida

TL;DR não. :slight_smile:

Versão longa:

Este é um plugin interno que usamos em nossa hospedagem (semelhante ao “site hospedado” da CDCK) que adiciona alguns recursos extras que precisamos para hospedar o site. Esta linha específica substitui o “não encontrado” do multisite por uma mensagem de erro mais detalhada que indica que o proprietário do site provavelmente configurou incorretamente seu DNS.

Como ele corrige o middleware do multisite, cada solicitação em todos os sites que hospedamos passa por ele. Se você vir este plugin em um rastreamento de pilha, e a linha lib/middleware/enforce_hostname.rb estiver imediatamente acima dele, é uma chamada normal e não a causa do problema.

3 curtidas

Você está no branch estável? Talvez a atualização tenha quebrado o plugin no estável. Então, poderia ajudar se uma entrada fosse adicionada ao arquivo de compatibilidade.

2 curtidas

@Moin Não sei, como posso verificar em qual branch estou?

1 curtida

Sim, você está na versão estável @jackierenee.

5 curtidas

Obrigado por confirmar @RGJ

Então, preciso apenas aguardar o pino de compatibilidade antes de adicionar este componente de volta ao nosso site?

Estou trabalhando em um PR que espero que corrija este problema.

3 curtidas

Sim :+1:

1 curtida

Claro.

Sem o Componente de Tema, o texto na descrição da categoria é --font-up-3 por padrão. Isso é feito através da classe .category-heading. Acho que isso cresceu nos últimos tempos.

Com o Componente de Tema, o texto na descrição da categoria é --font-0. Isso pode ser aumentado para --font-up-1 (maior) ou font-up-2 (o maior). Nenhum desses atinge o novo normal!

1 curtida

Certo, está bom assim?
smaller -
--font-up-2
normal -
--font-up-3
larger -
--font-up-4
largest -
--font-up-5
Cc: @Rhidian

1 curtida

Oi @jackierenee, eu mesclei um PR. Você poderia tentar atualizar e ver se funciona?

1 curtida

Olá @NateDhaliwal Acabei de tentar atualizar e adicionei o componente de volta ao meu site. As páginas de categoria ainda estão em branco.

E se eu tentar usá-lo em combinação com as caixas de categoria mínimas, também obtenho uma página inicial em branco.

Talvez eu esteja fazendo algo errado, mas não sei como resolver.

Também recebi um erro na parte superior do meu site agora:

Mais um detalhe, acho que este é o log de erros relacionado a essa mensagem de erro:

Message (4472 cópias relatadas)

[db6814] ActionController::RoutingError (Nenhuma rota corresponde a [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'
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 `
vendor/bundle/ruby/3.3.0/bin/unicorn:25:in `load'
vendor/bundle/ruby/3.3.0/bin/unicorn:25:in `

Env

HTTP HOSTS: community.eaie.org

Obrigado!

Existem erros no console do navegador?
Você poderia compartilhar a versão do Discourse em que você está atualmente? Isso na página /admin.
Obrigado!

Olá @NateDhaliwal, desculpe, não sei o que os erros no console do navegador significam exatamente.

Acredito que esta seja a versão do Discourse que estou executando: Discourse 3.4.6 - GitHub - discourse/discourse: A platform for community discussion. Free, open, simple. versão 3d149ba8244585f4bcb41db77aa8825e72468bdb

Olá @NateDhaliwal, desculpe, eu consegui resolver, aqui estão alguns dos erros:

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)Entenda este erro
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:1Entenda este erro
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)Entenda este erro
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:1Entenda este erro
1 curtida

Isso é muito estranho. É estranho que este erro esteja aparecendo agora, já que this.site.mobileView estava na versão original :thinking:. Não consigo reproduzir isso com os testes mais recentes que passaram, poderia ser uma limitação do estável (embora, isso pareça improvável - o core também usa isso).