MarcC Posted September 11, 2024 Posted September 11, 2024 Hi, Related to this thread I started recently, I wanted to follow up and check on the expected behavior for the Tracy Debugger Console. In my template files, there was a preg_replace operation on the $page->body property. The TD Console showed the result of this template operation after executing "echo $page->body". Is this the normal / expected behavior, as opposed to simply showing the field HTML content from the DB? The DB itself showed the unchanged HTML for the body field. Just wanted to check since it will help me understand how to troubleshoot better next time. Thanks!
adrian Posted September 11, 2024 Posted September 11, 2024 Hi @MarcC - it should only work that way if you check the "Template resources" option in the Console. If it's happening for you without that checked can you please provide the exact code you have in your template that is resulting in this. 1 1
BrendonKoz Posted September 12, 2024 Posted September 12, 2024 14 hours ago, adrian said: Hi MarcC - it should only work that way if you check the "Template resources" option in the Console. I didn't even know that was a thing! ❤️ 1
MarcC Posted September 12, 2024 Author Posted September 12, 2024 On 9/11/2024 at 4:20 PM, adrian said: Hi @MarcC - it should only work that way if you check the "Template resources" option in the Console. If it's happening for you without that checked can you please provide the exact code you have in your template that is resulting in this. That's an awesome feature, I'll look into it further. Thank you.
adrian Posted September 12, 2024 Posted September 12, 2024 @MarcC - your response makes me think I didn't explain things properly because given the behavior you're seeing, I feel like you are probably already using that feature. If you're not using it, then there might be a bug causing the issue you are seeing so it would be great to know more about how you have things set up. 1
MarcC Posted September 13, 2024 Author Posted September 13, 2024 17 minutes ago, adrian said: @MarcC - your response makes me think I didn't explain things properly because given the behavior you're seeing, I feel like you are probably already using that feature. If you're not using it, then there might be a bug causing the issue you are seeing so it would be great to know more about how you have things set up. Ah, I was guessing that the feature might have been enabled by default when I installed the module, or otherwise bumped 😅. But if not default...I kinda doubt I bumped it... I don't see it anywhere now that I'm looking. v4.26.36, somewhere in the Console panel? I do see references to the term "Template resources" in settings and I was able to add the separate $ panel to the front end view. That's a really helpful panel btw.
adrian Posted September 13, 2024 Posted September 13, 2024 It will appear as a checkbox on the Console when used on the frontend. Compare: with: The code in home.php is: $page->title = 'Test modify'; which only takes effect if that "Template resources" option is checked. 1
MarcC Posted September 13, 2024 Author Posted September 13, 2024 25 minutes ago, adrian said: It will appear as a checkbox on the Console when used on the frontend. Compare: ... which only takes effect if that "Template resources" option is checked. OK, thanks! I see it now, on the front end. I upgraded the module since my investigation, so maybe I was encountering something going on with a previous version. I was testing on the back end, this checkbox wasn't there, and I was getting template-processed output. (Edit: I can check again just in case...)
adrian Posted September 13, 2024 Posted September 13, 2024 If you were testing on the backend, I am struggling to figure out how a template could be involved. I don't even know how it would get the code the from the template. Can you please provide the relevant code from the template and the code you were running in the console that is causing this. Otherwise I really am just guessing :) 2
MarcC Posted September 13, 2024 Author Posted September 13, 2024 39 minutes ago, adrian said: If you were testing on the backend, I am struggling to figure out how a template could be involved. I don't even know how it would get the code the from the template. Can you please provide the relevant code from the template and the code you were running in the console that is causing this. Otherwise I really am just guessing 🙂 OK. I am going to try to reproduce first. Because it would suck to hand over to you the very simple regex-replace code which now does nothing out of the ordinary, post-the-recent-module-upgrade. 😄 And thanks again for your kind response. 👍
adrian Posted September 18, 2024 Posted September 18, 2024 On 9/12/2024 at 5:55 PM, MarcC said: I upgraded the module since my investigation, so maybe I was encountering something going on with a previous version. What version were you running before?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now