Kunena 6.3.2 released

The Kunena team has announce the arrival of Kunena 6.3.2 [K 6.3.2] in stable which is now available for download as a native Joomla extension for J! 4.4.x/5.0.x/5.1.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 and issues discovered during the last development stages of K 6.3
Note: Please go to the Kunena Dashboard after an upgrade so that the Kunena database tables are also updated.

Please note: The Kunena project team takes NO responsibility for maintaining nor supporting anything in this category.

Question onKunenaBeforeSave - how to prevent a message being posted?

More
9 months 3 weeks ago #1 by c_schmitz
Hello,

I am currently writing a plugin which is using onKunenaBeforeSave to check the content of a message.
If he content is not approved by that check, I would like to abort the save and show a message to the user ("You are a spammer - bog off").
Showing a message is not a problem, but I don't see a clean way to abort the save? Even throwing a hard exception would still let the message save.
I am using Kunena 6.1.3.1.

Any help or insight would be very much appreciated.
 

Please Log in or Create an account to join the conversation.

More
9 months 2 weeks ago #2 by xillibit
Hello,

The place github.com/Kunena/Kunena-Forum/blob/0d10...abaseObject.php#L230 where the event onKunenaBeforeSave is triggered has right a catch. It could be at some level where the exception isn't catched

I don't provide support by PM, because this can be useful for someone else.

Please Log in or Create an account to join the conversation.

More
9 months 2 weeks ago - 9 months 2 weeks ago #3 by c_schmitz
Hello,

thank you for your kind reply.
I will check again my code.
Best regards
Carsten
Last edit: 9 months 2 weeks ago by c_schmitz.

Please Log in or Create an account to join the conversation.

More
9 months 2 days ago - 9 months 2 days ago #4 by c_schmitz
I had a working way, but now the new Private Message function is throwing an error, when my plugins prevents the message of being posted. This happens because postPrivateMessage expects a $message->id which is not available, because there is no message.
Last edit: 9 months 2 days ago by c_schmitz.

Please Log in or Create an account to join the conversation.

Time to create page: 0.531 seconds