Jump to content

Threaded Comments


matjash
 Share

Recommended Posts

Hmm, that is weird as it does not work on two different computers, but will try it on another PC to move the profile and see. I am checking if there are any caches right now but by default I keep them disabled so that should not be the issue.

P.S. I ran the bd($input->post->cite) in TracyDebugger and got an error:

500: Internal Server Error
See the browser dev console for the actual error

It seems like a strange server issue, however if I try to call $user->name somewhere else within the same template, I get the proper value (in my case test). Tried switching up the user and it is always the correct one. Thinking to redo the whole comment form using your earlier example and see if that would help.

Link to comment
Share on other sites

I just added:

bd($input->post->cite); 

to the:

if ($input->post->submit) {

block and it output the name correctly. Where are you putting it?

Did you check the browser dev console for info on the 500 error?

Link to comment
Share on other sites

Just now, MilenKo said:

Well I put it to the console which I guess was not the smartest thing to do. That is why I get the 500 error... I will need to read more about the Tracy...

The console is awesome, but it won't have access to $input->post->cite because you haven't submitted the form to the console. That said, I also don't know why you are getting a 500 error. If I run that bd call in the console it just returns null as you would expect because it isn't set. Anymore details on that 500 error? Do other bd calls in the console work ok, eg: bd('test');

Link to comment
Share on other sites

Well it appears like any bd i test shows similar error. I will try to remove Tracy and have it reinstalled to see what could be causing the issue (if I am even going to the right direction, however as far as it works with you, but not with me, that has to do something either with the server or pc setup) but not with the code.

 

tracy-debugger-result.jpg

Link to comment
Share on other sites

Oops I did it again... So yes, it was the semicolon which I forgot to put thinking the PC would know my intentions. So back to the point, after adding the semicolon, bd($input->post->cite); returns empty result in 2ms. Unfortunately that does not point me to the reason why it is not populating only in the form but everywhere else in the template it works fine (to call $user->name). Calling bd($user->name) returned empty result as well which should be good but...

Link to comment
Share on other sites

@adrian After a short break and becoming a father for 4th time, I had a few minutes to redo the comments form and it seems to work fine now. The only thing I could think of messing around would be to have some browser cache for the logged on user form. Today I echoed $user->name above the contact form and noticed that I had to refresh a few times before the name of the logged on user shows correctly.

As far as I did not yet activate the cache, I would expect it not to happen but will see what can be done. So for now the comments form is working as expected and I can close that chapter as well. I am thinking on adding some email verification if allowing non-registered users to post comments, but that is beyond this topic.

So again, thank you very much for the help and sharing.

  • Like 2
Link to comment
Share on other sites

I can confirm that using Incognito mode in Chrome or private in any other browser did the trick and as soon as I am logged-in, the browser shows the value of $user->name correctly. Same thing applies for the comments posted from any account or just as a guest if I unhide the name, email, web etc. It would be interesting to see how to style my form using the default rendering method for the comments as I can apply the styles if I am building a site from scratch however using a premade theme is a bit different story and I should digg deeper into the CSS to make the necessary adjustments to the styles of the comment field to match the design. Anyway it is a learning process and every week I am eager to read about the new stuff and thinking how can I use that. I am doing in paralel a few projects so once I establish the proper way to achieve this and that, the rest would be just to make it work for the specific frontend.

Thank you all for the achievements, as i won't make it this far without the shared ideas, advices, best practices and so forth. You are the ones that make PW growing in popularity!

Link to comment
Share on other sites

  • 2 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...