Kunena 6.1.3.2 Released

The Kunena team has announce the arrival of Kunena 6.1.3.2 [K 6.1.3] which is now available for download as a native Joomla extension for J! 4.2.x/4.3.x. This version addresses most of the issues that were discovered in K 6.1.0 and issues discovered during the last development stages of K 6.1

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
2 weeks 4 days 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
2 weeks 4 days 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
2 weeks 3 days ago - 2 weeks 3 days ago #3 by c_schmitz
Hello,

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

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

More
1 hour 11 minutes ago - 1 hour 10 minutes 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: 1 hour 10 minutes ago by c_schmitz.

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

Time to create page: 0.251 seconds