Boutons de trading

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

1 « J'aime »

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 « J'aime »

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 « J'aime »

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 « J'aime »

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 « J'aime »

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 « J'aime »

Salut @Janno_Liivak, merci beaucoup pour le plugin !

Veuillez ajouter une traduction en russe. Je l’ai mise en texte brut ci-dessous.

server.ru.yml

fr:
  site_settings:
    topic_trade_buttons_enabled: "Activer les boutons de gestion de la vente ?"
  topic_trading:
    sold: Vendu
    purchased: Acheté
    exchanged: Échangé
    cancelled: Retiré de la vente

client.ru.yml

fr:
  js:
    topic_trading:
      enable_sold_button: Activer le bouton « Vendu »
      enable_purchased_button: Activer le bouton « Acheté »
      enable_exchanged_button: Activer le bouton « Échangé »
      enable_cancelled_button: Activer le bouton « Retiré de la vente »
      sold: Vendu
      purchased: Acheté
      exchanged: Échangé
      cancelled: Retiré de la vente
      error_while_marked_as_sold: Une erreur est survenue lors du marquage comme « Vendu »
      error_while_marked_as_purchased: Une erreur est survenue lors du marquage comme « Acheté »
      error_while_marked_as_exchanged: Une erreur est survenue lors du marquage comme « Échangé »
      error_while_marked_as_cancelled: Une erreur est survenue lors du marquage comme « Retiré de la vente »
      mark_as_sold_confirm: Voulez-vous marquer l'annonce comme « Vendu » ?
      mark_as_purchased_confirm: Voulez-vous marquer l'annonce comme « Acheté » ?
      mark_as_exchanged_confirm: Voulez-vous marquer l'annonce comme « Échangé » ?
      mark_as_cancelled_confirm: Voulez-vous marquer l'annonce comme « Retiré de la vente » ?
3 « J'aime »

Bonjour, et merci @Dmitry_Krasnoperov ! J’ai ajouté la traduction en russe.

Pour les autres utilisateurs du plugin… pas besoin de mettre à jour le plugin si le russe ne fait pas partie de vos langues autorisées… car rien d’autre n’a changé.

2 « J'aime »

C’ÉTAIT SUPER RAPIDE !!! Mettez-le en production maintenant.

3 « J'aime »

Bonjour Janno,

J’ai réalisé une traduction en allemand pour votre plugin. Serait-il possible de les intégrer à votre plugin ?

Il vous suffit de le renommer en .yml, car Discourse ne permet pas de le télécharger.
client.de.txt (1,1 Ko)
server.de.txt (218 octets)

4 « J'aime »

Bonjour, @Lagger_Gandalf ! Merci beaucoup. J’ai ajouté les traductions allemandes que vous avez fournies :slight_smile:

3 « J'aime »

Ne fonctionne pas sur mon forum ( triste

Essayez de redémarrer Discourse après avoir activé le plugin. Si cela ne fonctionne toujours pas, veuillez fournir plus d’informations sur votre problème. Vous pouvez m’envoyer un message en russe… Je le comprends plus ou moins :slight_smile:

1 « J'aime »

Salutations )) J’active tout) et je redémarre Discourse =/ rien ne change !

1 « J'aime »