-
Notifications
You must be signed in to change notification settings - Fork 5
Preview error #34
Comments
Could you please describe the file structure after submitting a comment for the first time on a page. As I understand it, it currently looks like this:
… instead of this:
|
My real folder structure now looks like this:
It creates On the page I remove
Because I added Update I just noticed that it creates Update 2 I wrote a double folder in the structure above. I've corrected it now. So there seems to be nothing wrong with the folder/file structure. Update 3 This is how my route looks like: // Items
foreach(page('items')->children() as $item) {
$items[] = '(' . $item->slug() . ')';
}
$kirby->set('route', [
'pattern' => $items,
'method' => 'GET|POST',
'action' => function($uid) {
return site()->visit('items/' . $uid);
}
]); |
I just added an invite to my private repository in case you want to test my site. |
I’ll have a look this afternoon. |
Did you look into it yesterday? I'm working with other issues in the meantime. If I don't get it solved I need to look for another comment system, but if I get it to work well in the end I will make a donation of 100EUR to your account, as soon as I get my first real comment from a user. :) |
Alright! :) If "natlan" works for you, then all of them probably work? I'm working in a localhost environment on Windows and I guess that's the problem? Something with the localhost session? I will try it on a test domain then and see if that works. It will be a sub domain, so I hope sub domains are supported by your plugin. |
Yes, all of them work. Because of the 300 error it has to fail in plugin/Comments.php between line 327 and line 335. Try logging ( |
Sorry about the delay. I've been doing other things. Now I have tried it on a test domain and it worked, except for the additional star rating which is saved wrong but I add a new issue about that. |
I did that now on my localhost where the problem still accur. I don't know what you can read from this but they are not equal, that's for sure. string(32) "3d8a27893b41a97d1be106cf2a4c71a4" Error 300 |
I can infer nothing from these IDs because they are just randomly generated strings. I suspect your local server modifies the PHP session during routing, that inevitably changes the session ID and invalidates the request. |
I can confirm that these strings changes every time I save/send the form. But maybe it should, I don't know. But I can use the panel without being logged out. Maybe we can add a option to skip the comparation of the strings? Something like Or don't compare the strings if the user is logged in into the panel. Maybe that would be better? A logged in user is probably not a spammer. If not, I need to hack the plugin in order to have a decent test environment. |
Got the same problem as @jenstornell - I omit the 'home' directory (as described in the cookbook) and land on an error page, when previewing and / or submitting a comment. Any ideas where to look? BTW upon disabling the route, I receive "Too few arguments to function Kirby\Component\Smartypants::parse()" error, coming from the // Edit: The smartypants error is related to this bug, which will be fixed in the next Kirby version. // Update: Yep, I may now comment stuff, but only when disabling my route: c::set('routes', array(
array(
'pattern' => '(:any)',
'action' => function($uid) {
$page = page($uid);
if(!$page) $page = page('home/' . $uid);
if(!$page) $page = site()->errorPage();
return site()->visit($page);
}
),
array(
'pattern' => 'home/(:any)',
'action' => function($uid) {
go($uid);
}
)
)); |
@S1SYPHOS I suspect the |
Hey there, Thank you so far! // Offtopic: Are there any known examples for (theoretically infinitely stacked) nested comments? |
I have cloned your project, switched to the |
No examples come to mind … maybe a long back-and-forth-discussion between two commentators? Kirby Comments can be used to nest comments theoretically infinitely deep if that is a feature that you require. |
I meant if you could provide an example on how to implement it 👍 |
@S1SYPHOS For an example implementation of nested comments you can try and download the Replies demo. It includes a snippet called nested-comments which renders both a comments list and a comments form. |
I'm currently trying out your snippet, but somehow it doesn't work, all comments are |
From the demo page:
You need a custom field to store the reference value. Something like this: c::set('comments.custom-fields', array(
array('name' => 'reply-to')
)); You can find out more about custom fields in the Custom Fields guide. |
Silly me, totally forgot about that - codesaver! // Edit: How could I go about if I wanted to reply via |
In the demo the nesting relationship is established using radio buttons with a name attribute of |
I have now tried this plugin for the first time and I get an error. When I click on the preview button I am sent to an error page with this url: #comment-1
I suspect it has to do with that I use a route for the page. Instead of
example.com/items/name
I useexample.com/name
.Any way around it?
Update
I get the same result if I just use submit directly.
Update 2
Maybe it's possible to force to send it to
items/name
for the comment creation and then redirect back to thename
page again, or redirect to a thankyou-page.Update 3
I changed my route to
'method' => 'GET|POST',
(included POST) and I changed the form to:Now I got the preview to work. When I try to submit I get error 300 which seems to be "The current session is invalid."
This time it created comments.txt (the archive) but no comments folders or comments.
The text was updated successfully, but these errors were encountered: