User ogulcan1787 reported an error when clicking the homepage logo, persisting even after updates and clearing custom code. Initial troubleshooting by JammyDodger suggested checking browser console and logs, while Arkshine identified issues with theme components and plugins. The root cause was traced to custom JavaScript that manipulated DOM elements containing Ember.js components, disrupting their lifecycle ogulcan1787. Arkshine advised using Discourse’s plugin API instead of direct DOM manipulation, providing a working solution using api.registerModelTransformer and api.onPageChange to safely move tags without breaking functionality. After initial success, ogulcan1787 noted duplicate tags appearing on logo clicks; Arkshine updated the code to prevent reprocessing. Further issues emerged in the “Latest” section and category pages, where tags either duplicated or failed to appear; Arkshine revised the script again to handle these edge cases. The final solution successfully positions tags as desired, matching the layout on https://pvpfarm.com, without breaking core functionality. ogulcan1787 expressed deep gratitude, calling Arkshine a “master.” For future paid assistance, JammyDodger suggested the Marketplace category. The fix relies on Discourse’s plugin API, not direct GitHub code, ensuring compatibility and maintainability.
Does this also happen in safe mode? Could you also check the browser console for errors when you click it, as well as looking in /logs to see if there’s any more detail.
You’re moving elements containing Emberjs components (here is the tags list), which I think likely disrupts the component’s lifecycle.
Your best bet here is to use the API.
In your case, either:
Using plugin outlets as I showed in your last topic. However since it doesn’t exist for the latest topics on the category page, you will need to request it.
Overwrite the template. This is not a good solution for compatibility reasons, but it can be an immediate alternative.
I would highly recommend you to not going that path. It’s like applying a band-aid to a side effect instead of fixing the root cause of the issue. You will create more problems with it (like your latest topic because of the above code)
You can make your JS a little more discourse friendly (the best way is still using plugin outlet when you can).
Here an example. It uses the API on page change, runs code on specific route, and copy the HTML before the link (so you can click on the tag):
@Arkshine Sorry for resurrecting the topic again.
Thank you again. I found an error in the codes you gave.
Can you help me please ?
I tried to correct the codes but I couldn’t.
In the Latest section, only the tag appears in the most recently opened tagged topic.
And when you enter a category, the tags do not appear.