To test: 1) Check you have comments activated (system preference: reviewson) 2) Add a comment to a record in the OPAC. The comment is shown with a light green background and the message: Your comment (preview, pending approval) 3) Refresh the page. Problem: The comment will no longer be shown to the logged in user. 4) Go into staff and approve the comment. (Tools > Comments) 5) Refresh the page in OPAC again. The comment shows up as "Your comment" correctly. 6) Edit the comment and change the text. Problem: Now 2 entries are shown in the comment list. One "Your comment" with the original text and one "Your comment (preview, pending approval)" with the edited text. It's confusing and looks like a new comment has been added. 7) Refresh the page. Problem: Both comments are gone. 8) Go into staff and approve the edited comment again. The edited comment is back and visible. I think the behaviour on refreshing the page is confusing to the patron. The comments should show in their current state whenever I get to the page while being logged in.
Created attachment 11647 [details] [review] Bug 8617 - Problem with display of comments waiting for moderation in OPAC This patch addresses on aspect of Bug 8617: The behavior where live previews of edited comments are displaying on opac-detail as a duplicate comment. We must pass the review id back to the script when submitting so that the check for it will evaluate as true when it should. This patch also corrects some JavaScript for translatability. To test, submit a comment on a title and approve it. Return to the title and edit the comment. When you submit your revised comment the comment pop-up window should close and your revised comment should appear on opac-detail as "pending approval."
The reason new and edited comments disappear when you refresh the page is that the only reason they appear on the page in the first place is because they're added by JavaScript when you submit them. I don't see any reason not to display unapproved comments by the logged-in user. I suppose it means adding an optional borrowernumber parameter to getallreviews so that we can ask for comments where approved = 1 OR borrowernumber = {borrowernumber}
Created attachment 11720 [details] [review] [SIGNED-OFF] Bug 8617 - Problem with display of comments waiting for moderation in OPAC Works as expected.
Created attachment 12223 [details] [review] Bug 8617 - Problem with display of comments waiting for moderation in OPAC This patch addresses on aspect of Bug 8617: The behavior where live previews of edited comments are displaying on opac-detail as a duplicate comment. We must pass the review id back to the script when submitting so that the check for it will evaluate as true when it should. This patch also corrects some JavaScript for translatability. To test, submit a comment on a title and approve it. Return to the title and edit the comment. When you submit your revised comment the comment pop-up window should close and your revised comment should appear on opac-detail as "pending approval."
(In reply to comment #3) > Created attachment 11720 [details] [review] > [SIGNED-OFF] Bug 8617 - Problem with display of comments waiting for > moderation in OPAC > > Works as expected. patch looks good, passing QA… $ koha-qa.pl testing 1 commit(s) (applied to commit 0acebb8) * 1834255 Bug 8617 - Problem with display of comments waiting for moderatio koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt * koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt OK
Patch pushed to master
Pushed to 3.8.x, will be in 3.8.6