Problems, need help? Have a tip or advice? Post it here.
17 posts Page 2 of 2
oldcelt wrote:
Really appreciate your help - donation made into your account this morning.

Thank you Kenneth, you are my second donor therefore I'll never forget you. Perhaps, I'll think about a priority list to put you in there :) Really appreciate your coin.

oldcelt wrote: I'm still a bit puzzled:-
1. A comment approved appears on the page under the name of the person submitting it but is repeated with the name of the ‘Admin’ attributed. In other words, the comment is duplicated.
2. I still can’t see any purpose for the button ‘Discuss this post’. It does nothing. Perhaps I misunderstood the earlier advice?
3. What is the purpose of users with less than ‘Admin’ privileges? There’s nowhere on the Aurelius site that offers a login for anyone. Is this provided in Couch for a web design which keeps a list of members for some reason?

TIA, Ken


1. I should probably see that myself, honestly it's been a long time since that tutorial. Care to attach your zipped template?

2. Perhaps there is none.. Someone else coded that Aurelius thing and @KK only used it to illustrate concepts. Maybe we can repurpose that link for a good use, if you need it. Something like to show-hide the commenting form? I mean clicking on that link would 'reveal' the comment area with comments via css/js or load them via ajax - those are just quick ideas.

3. Aurelius is used to sample a limited set of concepts. Couch has an "Extended Users" addon, which makes available custom editables for all users and makes possible to craft a designated user-area, accessible only by a certain user. There is another tutorial (Notejam tutorial https://www.couchcms.com/docs/advanced-tutorial/) if you want to explore that part.
Say `Please!` [̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]..... Active topics [Forum posts from previous 7 days].... helpcouch@mail.ru [My email for friends]
trendoman wrote:
oldcelt wrote:
Really appreciate your help - donation made into your account this morning.

Thank you Kenneth, you are my second donor therefore I'll never forget you. Perhaps, I'll think about a priority list to put you in there :) Really appreciate your coin.

oldcelt wrote: I'm still a bit puzzled:-
1. A comment approved appears on the page under the name of the person submitting it but is repeated with the name of the ‘Admin’ attributed. In other words, the comment is duplicated.
2. I still can’t see any purpose for the button ‘Discuss this post’. It does nothing. Perhaps I misunderstood the earlier advice?
3. What is the purpose of users with less than ‘Admin’ privileges? There’s nowhere on the Aurelius site that offers a login for anyone. Is this provided in Couch for a web design which keeps a list of members for some reason?

TIA, Ken


1. I should probably see that myself, honestly it's been a long time since that tutorial. Care to attach your zipped template?

2. Perhaps there is none.. Someone else coded that Aurelius thing and @KK only used it to illustrate concepts. Maybe we can repurpose that link for a good use, if you need it. Something like to show-hide the commenting form? I mean clicking on that link would 'reveal' the comment area with comments via css/js or load them via ajax - those are just quick ideas.

3. Aurelius is used to sample a limited set of concepts. Couch has an "Extended Users" addon, which makes available custom editables for all users and makes possible to craft a designated user-area, accessible only by a certain user. There is another tutorial (Notejam tutorial https://www.couchcms.com/docs/advanced-tutorial/) if you want to explore that part.

1. Do you want the zipped blog.php bit or something more?
2. More or less as I supposed but nice to have another opinion. Also, a couple of good ideas - thanks!
3. I'll have a look at the other tutorial but, sure, your thoughts are, again, much along the lines of my own thinking.

I tried to contact the Aurelius creator without success. I found a website which claims that the template is now free to use? I'm going to continue using it to develop my skills with Couch and, shortly, I'll put it up as my own website for test purposes. I just hope I'm not usurping the creator's rights in any way.
Yes, the zipped blog and its embedded snippets.
Say `Please!` [̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]..... Active topics [Forum posts from previous 7 days].... helpcouch@mail.ru [My email for friends]
trendoman wrote: Yes, the zipped blog and its embedded snippets.

OK, will have to be Monday now. Ta!
I have been able to reproduce the issue. It is a well-known 'feature' of resubmitting the entered form's data upon page reload. Browser sometimes asks to 'Confirm Form Resubmission' upon reload of the page.

It is easy to reproduce the problem - open 2 tabs in browser - one with backend and one with a blog's page holding a comment form. Submit the form as anonymous visitor, then switch to the tab with backend and login there as superadmin / admin to make Couch think that you are now a logged in user. Going back to the tab with the previously submitted form, reload it and Couch will post the comment again, as a logged in admin.

Why it happens? Well, normally in our forms we use k_success block, do some action with submitted data and then redirect the page somewhere (most often to itself) -

Code: Select all
<cms:redirect k_page_link />

It helps to reset form's values from both frontend and serverside. However, the comment snippet does not do that. It displays the success / error message to the user after submit and the submitted data is kept in serverside. That is why a double posting happens. @KK did code something to prevent double posting, but it is not enough for such corner case because his code checks for the same email which of course may not match in this case. Also, if Couch senses that user is logged in it ignores k_email and k_author fields and links the content of k_comment input directly to the logged in user regardless.

In conclusion, the snippet comment_form.html doesn't redirect the page upon comment submission, hence the problem with double post. In my best guess it should instead rely on flash messages (briefly mentioned here https://docs.couchcms.com/concepts/databound-forms.html and explained in 1.3.5 Release notes here viewtopic.php?f=5&t=7377 in Session Variables ) to show notice to the user after processing the comment *and* after redirecting the page to itself (or elsewhere).

Is this explanation clear enough?

Here I am attaching a revised snippet which does it the right way.

comments_form.zip
revised form submission with flashes
(1.26 KiB) Downloaded 33 times
Say `Please!` [̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]..... Active topics [Forum posts from previous 7 days].... helpcouch@mail.ru [My email for friends]
trendoman wrote: Is this explanation clear enough?

Here I am attaching a revised snippet which does it the right way.

comments_form.zip

Explanation is crystal clear; thank you very much indeed. Sorry about delay in replying: been out and about ;)
You are welcome :). Thanks for the feedback.
Say `Please!` [̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]..... Active topics [Forum posts from previous 7 days].... helpcouch@mail.ru [My email for friends]
17 posts Page 2 of 2

Who is online

In total there are 17 users online :: 0 registered, 0 hidden and 17 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 17 guests