Botões de Trading

Can you check your preferences page to see if the category has been muted for your user?

1 curtida

I was about to protest, because the reason I even discovered the problem was that users of the forum (I’m an admin) started complaining about the missing Classifieds section (Category). But you’re right, it is muted for my user. The thing is, I never muted it. Also, it must be muted for other users as well then, since they’re complaining.

How could that have happened?

Thanks!

Did you previously have the category set to be suppressed from the latest page? If so, the category was probably muted for all users on your site by a migration that occurred after that setting was removed. If this is the case, it can be fixed from the rails console.

2 curtidas

Nothing in the logs, no. Having re-found the Category (see previous message), I tried posting an ad. It worked but there are no buttons.

I can still see the buttons mentioned (and they’re all checked) in the Category Settings, but they don’t show up on my listings.

Any idea how that could be fixed?

Thanks!

No, at least not as far as I know. Users are complaining though, so it seems as if it has been muted for everyone. How can I fix that from the rails console?

Thanks!

First take a backup of your site in case anything goes wrong. Then:

# Get the category and assign it to a variable
c = Category.find_by(name: "<your category name>")

# Unmute the category for all users
CategoryUser.where(category_id: c.id, notification_level: 0).destroy_all

Edit:
If you’d like to see how many users the category has been muted for, before running the second command, try running

CategoryUser.where(category_id: c.id, notification_level: 0).count

That will return a count of users who have the category muted.

3 curtidas

the buttons are visible for topic author when he/she opens the topic… not in the topic list. Or what listing are you talikng about?

Never mind! After I unmuted the Category, the buttons are now showing. Or maybe it was the restart that cleared it. Either way, things are working again now. Sorry to have bothered you with this, thanks for your help!

Gunnar

1 curtida

I’m going to give that a try as soon as I get a chance. Thanks!

It’s @simon you should thank. He did the heavy lifting :wink:

2 curtidas

Simon,

=> 43653

Oops. :wink:

I have to admit, that .destroy_all part of the above command looks scary. What does it do, just remove the mute flag?

Thanks again!

Any destructive actions run on the console are a little scary. Make sure you take a backup before running them.

A CategoryUser record describes a user’s notification level for a category. A notification_level of 0 means that the category is muted for the user. You can find more information here: (Obsolete) Set category tracking level defaults historically.

Deleting all CategoryUser records for a given category_id with a notification_level of 0, will remove that category from the muted list for all users on your site.

When I run a command like this, I usually add an extra step that I didn’t post above. Instead of running

CategoryUser.where(category_id: c.id, notification_level: 0).destroy_all

in a single step, I’ll assign the records to a variable so that I can double check that I’m dealing with the correct data. Something like this:

# Get the category and assign it to a variable
c = Category.find_by(name: "<your category name>")

# Assign the category_users to a variable and examine the data. Make sure the records have the
# correct category_id etc.
muted_category_users = CategoryUser.where(category_id: c.id, notification_level: 0)

# When you are certain that the data is correct run
muted_category_users.destroy_all
3 curtidas

Olá @Janno_Liivak, muito obrigado pelo plugin!

Por favor, adicione a tradução em russo. Coloquei abaixo em texto simples.

server.ru.yml

ru:
  site_settings:
    topic_trade_buttons_enabled: "Ativar botões de controle de venda?"
  topic_trading:
    sold: Vendido
    purchased: Comprado
    exchanged: Trocado
    cancelled: Removido da venda

client.ru.yml

ru:
  js:
    topic_trading:
      enable_sold_button: Ativar botão 'Vendido'
      enable_purchased_button: Ativar botão 'Comprado'
      enable_exchanged_button: Ativar botão 'Trocado'
      enable_cancelled_button: Ativar botão 'Removido da venda'
      sold: Vendido
      purchased: Comprado
      exchanged: Trocado
      cancelled: Removido da venda
      error_while_marked_as_sold: Ocorreu um erro ao marcar como 'Vendido'
      error_while_marked_as_purchased: Ocorreu um erro ao marcar como 'Comprado'
      error_while_marked_as_exchanged: Ocorreu um erro ao marcar como 'Trocado'
      error_while_marked_as_cancelled: Ocorreu um erro ao marcar como 'Removido da venda'
      mark_as_sold_confirm: Deseja marcar o anúncio como 'Vendido'?
      mark_as_purchased_confirm: Deseja marcar o anúncio como 'Comprado'?
      mark_as_exchanged_confirm: Deseja marcar o anúncio como 'Trocado'?
      mark_as_cancelled_confirm: Deseja marcar o anúncio como 'Removido da venda'?"}
3 curtidas

Olá, e obrigado @Dmitry_Krasnoperov! Adicionei a tradução para o russo.

Para outros usuários do plugin… não há necessidade de atualizar o plugin se o russo não estiver incluído nas suas línguas permitidas… pois nada mais mudou.

2 curtidas

ISSO FOI SUPER RÁPIDO!!! Coloque em produção agora.

3 curtidas

Oi Janno

Fiz uma tradução para o alemão do seu Plugin. Seria possível você adicioná-la ao seu Plugin?

Você só precisa renomeá-la para .yml, pois o Discourse não permite o upload dela.
client.de.txt (1.1 KB)
server.de.txt (218 Bytes)

4 curtidas

Olá, @Lagger_Gandalf! Muito obrigado. Adicionei as traduções para alemão que você forneceu :slight_smile:

3 curtidas

Não está funcionando no meu fórum ( triste

Tente reiniciar o Discourse após ativar o plugin. Se ainda não funcionar, tente fornecer mais informações sobre o seu problema. Você pode me enviar uma mensagem em russo… Eu entendo mais ou menos :slight_smile:

1 curtida

Saudações )) Ativei tudo) e reiniciei o Discourse =/ nada mudou!

1 curtida