Hello! ππ»
I am Maurice, I am developing ideas & tools for digital storytelling and an open web.
A Kirby comment plugin
License: MIT License
Hello! ππ»
I am Maurice, I am developing ideas & tools for digital storytelling and an open web.
Right after installing Komments 1.3.0 on a Kirby 3.6.0-rc.4 build I get the following error message in the developer console after trying to publish a test comment (no change on the panel page visible):
index.js:1 POST https://dev.domain.de/api/komments/publish 500
request @ index.js:1
post @ index.js:1
publish @ index.js?1636570749:349
click @ index.js?1636570749:349
Vt @ vendor.js:6
n @ vendor.js:6
Vt @ vendor.js:6
n @ vendor.js:6
i._wrapper @ vendor.js:6
index.js:1 {status: 'error', message: "Class 'mauricerenck\Komments\Exception' not found", code: 500, exception: 'Error', key: null,Β β¦}code: 500details: Array(0)length: 0[[Prototype]]: Array(0)exception: "Error"file: "../dev.domain.de/site/plugins/komments/utils/moderation.php"key: nullline: 143message: "Class 'mauricerenck\Komments\Exception' not found"route: "komments/publish"status: "error"[[Prototype]]: Objectconstructor: Ζ Object()hasOwnProperty: Ζ hasOwnProperty()isPrototypeOf: Ζ isPrototypeOf()propertyIsEnumerable: Ζ propertyIsEnumerable()toLocaleString: Ζ toLocaleString()toString: Ζ toString()valueOf: Ζ valueOf()defineGetter: Ζ defineGetter()defineSetter: Ζ defineSetter()lookupGetter: Ζ lookupGetter()lookupSetter: Ζ lookupSetter()proto: (...)get proto: Ζ proto()set proto: Ζ proto()
onError @ index.js:1
request @ index.js:1
await in request (async)
post @ index.js:1
publish @ index.js?1636570749:349
click @ index.js?1636570749:349
Vt @ vendor.js:6
n @ vendor.js:6
Vt @ vendor.js:6
n @ vendor.js:6
i._wrapper @ vendor.js:6
komments:1 Uncaught (in promise) {status: 'error', message: "Class 'mauricerenck\Komments\Exception' not found", code: 500, exception: 'Error', key: null,Β β¦}code: 500details: []exception: "Error"file: "../dev.domain.de/site/plugins/komments/utils/moderation.php"key: nullline: 143message: "Class 'mauricerenck\Komments\Exception' not found"route: "komments/publish"status: "error"[[Prototype]]: Object
Promise.then (async)
publish @ index.js?1636570749:349
click @ index.js?1636570749:349
Vt @ vendor.js:6
n @ vendor.js:6
Vt @ vendor.js:6
n @ vendor.js:6
i._wrapper @ vendor.js:6
see: #35 (comment)
Notify panel users about new komments via browser push
main
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can fix this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here are some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
An npm token must be created and set in the NPM_TOKEN
environment variable on your CI environment.
Please make sure to create an npm token and to set it in the NPM_TOKEN
environment variable on your CI environment. The token must allow to publish to the registry https://registry.npmjs.org/
.
Good luck with your project β¨
Your semantic-release bot π¦π
Spam email attack with some JavaScript and blind SQL injection method, afterwards, backend comments are not showing.
On the backend panel, the error is "Cannot read properties of undefined (reading 'dispatch')".
I deleted the comments from the content folder, and now it's working fine, but how can I deal with this using the plugin in the future?
Kirby: 3.10.0
Plugin: 1.11.1
Now I'm trying to change the version from 1.11.1 to 1.13.2, but in the backend panel, the comments list and details are not showing properly. (HTML and CSS need to adjust). Can you please guide me.
If kirby is installed in a subfolder the current form actions won't work. Use the url() method to fix this.
I have installed and integrated your plugin to my Kirby 3.6.0 alpha test installation and when I try to post a comment I get an error message the the page cannot be found:
POST https://domain.tld/kirbytest/komments/send 404
sendKomment @ komments.js:78
(anonymous) @ komments.js:122
Could this be related to the 3.6 build?
Debugging turned on doesn't help.
Currently replies have an
After installing the latest Komments plugin via composer on a Kirby 3.6.0-rc.3 environment I just get an error 500 message for the panel and the website without any additional information in the browser console or the apache error log.
(in the screenshot Komments is not listed because if it is installed I couldn't open the panel anymore).
Is there a way to see the commenter's email address? They asked a question on our blog and we wanted to answer them personally. Thank you!
Queue new comments and webmentions before storing them in markdown. Usefull for sites with a lot of reactions.
I found a crazy thing in the plugin.
If I change a simple text on any page in the panel and then click save, I see a file named outbox.json in the files section.
This only happens on listed (public) sites.
My website runs on PHP8. I have not installed any other plugins.
I have the same thing when i try to you use your plugin with the kirby starterkit
Do you possibly know what this is related to?
Thanks for the great plugin!
Would it be possible to receive an email notification as soon as a new comment has been made?
Using version 1.5.1 of this plugin together with Kirby 3.6.1 gives a JSON.parse
error upon submitting a comment.
The comment gets submitted and I'm able to review it in the dashboard, but the form feedback element div.form-feedback
doesn't work as no text appears and the class .moderation-note
doesn't get added.
I could fix this problem.
In komments/utils/receiveKomment.php
, line 165, I changed the following:
Before (not working)
public function sendReponseToClient(string $headlineTranslationString, string $messageTranslationString, number $httpCode, boolean $shouldReturnJson)
After (working)
public function sendReponseToClient(string $headlineTranslationString, string $messageTranslationString, number $httpCode, bool $shouldReturnJson)
I am using strftime instead of the default date schema and Komments doesn't show time/date in the templates.
Can you please add support for it (or an option in the config)?
I am using Kirby 4 with the Zero One theme.
I installed Komments with composer.
In config I have:
'mauricerenck.komments.komment-auto-publish' => false,
'mauricerenck.komments.auto-publish-verified' => false,
'mauricerenck.komments.webmention-auto-publish' => false,
I put the css snippet in header per instructions.
Then placed the other two snippets lower in the template for the comments.
In my article blueprint I added:
sections:
komments:
extends: sections/komments
When I open the article in the panel I can see that the messages are only pending and not approved, but when I view the main website the pending messages are still shown.
The main Komments tab from within the panel has not had any pending comments show up on it at all.
I'm using komments and indieConnector with brid.gy to backfeed responses from my mastodon account into my posts.
When the webmention gets created on my post, it includes the author url in a field called authorUrl
. The komments panel however, looks for a field called authorurl
(with a lower u) which leads to an error in this code:
/var/www/kirby/site/plugins/komments/utils/base.php
foreach ($collection as $item) {
if ($item->kommentsInbox()->isNotEmpty()) {
foreach ($item->kommentsInbox()->yaml() as $komment) {
$komment['spamlevel'] = (isset($komment['spamlevel'])) ? $komment['spamlevel'] : 0; // backward compatiblity
if (($komment['status'] === 'false' || $komment['status'] === false)) {
$pendingKomments[] = [
'id' => $komment['id'],
'slug' => $item->id(),
'author' => $komment['author'],
'authorUrl' => $komment['authorurl'],
'komment' => kirbytext(nl2br(html($komment['komment']))),
'kommentType' => (isset($komment['kommenttype'])) ? $komment['kommenttype'] : 'komment', // backward compatiblity
'image' => $komment['avatar'],
'title' => (string) $item->title(),
'url' => $item->panel()->url(),
'published' => date('Y-m-d H:i', strtotime($komment['published'])),
'verified' => ($komment['verified'] === true || $komment['verified'] === 'true') ? true : false,
'spamlevel' => $komment['spamlevel'],
'status' => ($komment['status'] === true || $komment['status'] === 'true') ? true : false,
Hi Maurice,
I'm running Kirby 3.6 as headless CMS with Nuxt.js and I was wondering if there is a way I can send comments from the frontend to Kirby using your Plugin?
Does the plugin offers an endpoint where I could send the formData? or is there any other way this could work?
Thank you for your great plugins!
Best,
Juan
Hi. I was trying to setup indieConnector + komments, and faced an issue (after working around mauricerenck/indieConnector#8):
The webmentions from mastodon/fediverse via fed.brid.gy do not have author email address, so I get the following error:
AH01071: Got error 'PHP message: Whoops\Exception\ErrorException: Undefined array key "email" in /var/www/html/site/plugins/komments/utils/receiveKomment.php:54
Stack trace:
#0 /var/www/html/site/plugins/komments/utils/receiveKomment.php(54): Whoops\Run->handleError()
#1 /var/www/html/site/plugins/komments/components/hooks.php(31): mauricerenck\Komments\KommentReceiver->createKomment()
#2 [internal function]: Kirby\Cms\App->mauricerenck\Komments\{closure}()
#3 /var/www/html/vendor/getkirby/cms/src/Toolkit/Controller.php(58): Closure->call()
#4 /var/www/html/vendor/getkirby/cms/src/Cms/Event.php(165): Kirby\Toolkit\Controller->call()
#5 /var/www/html/vendor/getkirby/cms/src/Cms/App.php(1700): Kirby\Cms\Event->call()
#6 /var/www/html/site/plugins/indieconnector/utils/hookHelper.php(18): Kirby\Cms\App->trigger()
#7 /var/www/html/site/plugins/indieconnector/index.php(63): mauricerenck\IndieConnector\HookHelper->triggerHook()
#8 [internal function]: Kirby\Http\Route->mauricerenck\IndieConnector\{closure}()
#9 /var/www/htm...'
If I add a check array_key_exists('email', $webmention['author'])
and pass an empty string as authorEmail
if the email does not exist, it works.
Should I raise a PR with this change? Are there other fields you recommend checking for existence before saving the comment?
I have installed Komments together with the kirby-matomo plugin and the panel blueprint of the Matomo plugin doesn't work anymore after installing Komments.
The developer console shows the following error:
Uncaught ReferenceError: $bhZj$exports is not defined
at index.js?1629713017:formatted:277
at index.js?1629713017:formatted:2609
Line 277 looks like this:
var aa, Cb, ba, Ea = ga.MAX_SAFE_COMPONENT_LENGTH, Db = ($bhZj$exports = {}).re = aa = [], k = (Cb = []), x = (ba = {}), Eb = 0, z = function($, r, a) {
Right after installing Komments 1.3.0 on a Kirby 3.6.0-rc.4 build I get the following error message in the Panel after switching to the Komments page:
Cannot read properties of undefined (reading 'id')
This is the output of the developer console:
TypeError: Cannot read properties of undefined (reading 'id')
at a.created (index.js:349)
at Vt (/media/panel/0d2fe3c1d0376b43026a4c53ad4add22/js/vendor.js:6)
at nn (/media/panel/0d2fe3c1d0376b43026a4c53ad4add22/js/vendor.js:6)
at a.Cn._init (/media/panel/0d2fe3c1d0376b43026a4c53ad4add22/js/vendor.js:6)
at new a (/media/panel/0d2fe3c1d0376b43026a4c53ad4add22/js/vendor.js:6)
at /media/panel/0d2fe3c1d0376b43026a4c53ad4add22/js/vendor.js:6
at init (/media/panel/0d2fe3c1d0376b43026a4c53ad4add22/js/vendor.js:6)
at /media/panel/0d2fe3c1d0376b43026a4c53ad4add22/js/vendor.js:6
at f (/media/panel/0d2fe3c1d0376b43026a4c53ad4add22/js/vendor.js:6)
at a.patch (/media/panel/0d2fe3c1d0376b43026a4c53ad4add22/js/vendor.js:6)
t.config.errorHandler @ index.js:1
This is the mentioned line in the index.js (here the third one):
created() {
this.kommentList = this.queuedKomments,
this.selectKomment(this.kommentList[0].id),
this.loadKomments()
},
The error is gone once there are comments shown on the page.
The komments plugin is working fine on the frontend. But the panel area is broken. If want to view it I get redirected to myurl.test/api/komments/queued
and the following message appears:
{
"status": "error",
"message": "Unauthenticated",
"code": 401,
"exception": "Kirby\\Exception\\AuthException",
"key": "error.auth",
"file": "authentication.php",
"line": 14,
"details": [],
"route": "komments/queued"
}
Some background first:
I've set up the plugin based on your instructions here on GH. Got the panel, templates and all ready. Customized couple options in the config. Created one custom snippet for rendering the reply (really just updated layout).
Adding comments on the default language works without problems.
But when trying to comment on the translated version, I'm getting The page you wrote a comment for could not be found.
error and no comment ever gets saved (checked via Panel and my content file).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.