adrian Posted March 12, 2021 Share Posted March 12, 2021 Hi, Has anyone else come across an issue with the approval link in the comment emails? The message is: "Invalid comment code or code has already been used" but the problem is that no code or subcode was ever created in the DB table. I am seeing this on all comments on a new site I am finishing up, but looking back at another site using the comment system I see that sometimes no code was entered there either. I thought it might be related to logged in users, but even guest users don't get the code and same goes for users without already approved comments. Anyone also seeing something like this? Link to comment Share on other sites More sharing options...
kongondo Posted March 12, 2021 Share Posted March 12, 2021 1 hour ago, adrian said: Has anyone else come across an issue with the approval link in the comment emails? Not on a site, but I have noticed something similar (If I recall correctly), when approving comments sent to me by ProcessWire for approval with respect to comments left on my modules' pages in the modules directory (hope this makes sense...Friday, tired and all that ?). 1 Link to comment Share on other sites More sharing options...
adrian Posted March 13, 2021 Author Share Posted March 13, 2021 Thanks @kongondo - sounds like I'll have to investigate a bit further to see if I can narrow it down and possible file a bug report. Link to comment Share on other sites More sharing options...
adrian Posted March 15, 2021 Author Share Posted March 15, 2021 Ok, I went a wandering into the comments fieldtype code and discovered it was because the schemaVersion setting for the field was set to "1" whereas it should be "6". I've made that change and it seems to be working fine now. As to why it was set to 1 and not 6, I have no idea - maybe someone else will come across this and it will help them to solve it as well. 3 Link to comment Share on other sites More sharing options...
digitex Posted April 13, 2021 Share Posted April 13, 2021 On 3/15/2021 at 6:26 PM, adrian said: Ok, I went a wandering into the comments fieldtype code and discovered it was because the schemaVersion setting for the field was set to "1" whereas it should be "6". I've made that change and it seems to be working fine now. As to why it was set to 1 and not 6, I have no idea - maybe someone else will come across this and it will help them to solve it as well. Can you narrow things down for me adrian? I'm having the same problem but there's a lot of code to go through and I don't know where to look. Please. Link to comment Share on other sites More sharing options...
adrian Posted April 13, 2021 Author Share Posted April 13, 2021 27 minutes ago, digitex said: Can you narrow things down for me adrian? I'm having the same problem but there's a lot of code to go through and I don't know where to look. Please. Just a matter of changing the value in the field's settings JSON. 1 Link to comment Share on other sites More sharing options...
digitex Posted April 14, 2021 Share Posted April 14, 2021 Thanks for the hint @adrian. The interface looks very different on my end but I found the settings. Seems my problem is different in more than one way: the schemaVersion is already set to 6. I don't see a message like you described, the approval email simply does nothing when clicking the approve link i.e. pending comments remain pending. I had hoped your issue and mine may have had a similar solution. Link to comment Share on other sites More sharing options...
adrian Posted April 14, 2021 Author Share Posted April 14, 2021 @digitex - that interface is simply "Adminer" which I include as part of Tracy. Of course you can view this via PHPMyAdmin or a desktop client like SequelAce. But it sounds like it's no use to you anyway. Hope you can dig in further and figure out what the problem might be. Link to comment Share on other sites More sharing options...
digitex Posted April 14, 2021 Share Posted April 14, 2021 5 hours ago, adrian said: @digitex - that interface is simply "Adminer" which I include as part of Tracy. Of course you can view this via PHPMyAdmin or a desktop client like SequelAce. But it sounds like it's no use to you anyway. Hope you can dig in further and figure out what the problem might be. I figured it was tracy, I was just marvelling at how much easier it is to read than phpMyAdmin. I found a solution here: This works. It's an odd behaviour for the Approve Now button in the notification email to only work when comments are rendered through the render function. I can work with it though ? Thanks for your help. 1 Link to comment Share on other sites More sharing options...
adrian Posted April 14, 2021 Author Share Posted April 14, 2021 Glad you got it sorted - if it's not already, I think this should be posted as an issue on Github. We desperately need to start culling these weird inconsistencies that waste hours of time and make you go grey ? 1 Link to comment Share on other sites More sharing options...
digitex Posted May 12, 2021 Share Posted May 12, 2021 While we're on the subject of comments ? I have another question. When notifications come in, I have never seen any actions other than "approve now". Many comments are not useful to the public, to say the least, so an admin won't want to approve but to do anything else requires logging in to manually mark as spam or delete. This kind of defeats the purpose of moderating directly from the notification email and if you do nothing the comments remain pending and clog up the system. I found the code in CommentNotifications.php that deals with moderation actions but I'm not certain how to add to it. if($comment->status == Comment::statusPending) { $status = $this->_("Pending Approval"); $actionURL .= "approve"; $actionLabel = $this->_('Approve Now'); } else if($comment->status == Comment::statusApproved) { $status = $this->_("Approved"); $actionURL .= "spam"; $actionLabel = $this->_('Mark as SPAM'); } else if($comment->status == Comment::statusSpam) { $status = sprintf($this->_("SPAM - will be deleted automatically after %d days"), $field->get('deleteSpamDays')); $actionURL .= "approve"; $actionLabel = $this->_('Not SPAM: Approve Now'); } else { $actionURL = ''; $actionLabel = ''; $status = "Unknown"; } Having the option to mark as spam on a pending comment seems like it would be very useful. 1 Link to comment Share on other sites More sharing options...
adrian Posted May 12, 2021 Author Share Posted May 12, 2021 @digitex - I think this idea is really needed - can you add to PW requests GH repo please? Link to comment Share on other sites More sharing options...
digitex Posted May 12, 2021 Share Posted May 12, 2021 5 hours ago, adrian said: @digitex - I think this idea is really needed - can you add to PW requests GH repo please? I'll put that on my to do list. I don't have a GH account yet so I'll have to set that up first. @adrian done. Thanks for the suggestion. Turns out I did already have GH account, it's just been so long since I logged in I had forgotten. Link to comment Share on other sites More sharing options...
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