Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

DiscussionModel_BeforeSaveDiscussion

cdavidcdavid New
edited August 2010 in Vanilla 2.0 - 2.8
Dear all,

In my learning experience with Vanilla, I am trying to develop a plugin that tries to intercept this event and access the Body of the Discussion that is about to be saved.

Unfortunately, I have failed at understanding what happens and how I can have access to the content that is being sent to the database (in my plugin I have an extra column in the Discussion table whose content I want to set during this event).

Is such a thing possible? Has it been done before? I tried looking in the forums, on Google, even tried a few addons, but failed to find such an example.

Summary:
I want to intercept the exact database fields that will be saved and modify them. Is this possible and, if yes, how?

Thanks in advance,

Catalin
Tagged:

Comments

  • Follow-up, for posterity:

    It is easier to handle the event data like this, AfterSave
    public function DiscussionModel_AfterSaveDiscussion_Handler (&$Sender){ $LaTeX = ArrayValue('Body',$Sender->EventArguments['Fields'], 0);//will give you the body }

    All good now, can go to sleep,

    /cd
Sign In or Register to comment.