Save custom field data while creating the thread.

ForumCube

Active member
#1
Hi,

I was trying to add custom field while thread creation which is done. Now I am trying merge this feild data with the thread data. So I target the "actionAddThread()" for that.

For this I extend this method and then return it to the parent class method. But when I check the input array in parent class, I cant inject the code in input array.

Here is my extended method.

class MyAddon_Listener extends XenForo_ControllerPublic_Forum
{

public function actionAddThread() {

$input[] = $this->_input->filter(array(
'ticker_title' => XenForo_Input::STRING));
return parent::actionAddThread();


}
}
But when I check the input array in the parent class it does not contain my data.
 

Milano

Well-known member
#2
Hi,

I was trying to add custom field while thread creation which is done. Now I am trying merge this feild data with the thread data. So I target the "actionAddThread()" for that.

For this I extend this method and then return it to the parent class method. But when I check the input array in parent class, I cant inject the code in input array.

Here is my extended method.



But when I check the input array in the parent class it does not contain my data.
You're doing it wrong, you need to extend your thread controller with XFCP_YourClassName and resolve it with Code Event Listener
 

ForumCube

Active member
#3
Hi Milano,

Thanks a lot. Yes you are right , I was doing this wrong.

Although I done this part of my plugin using waindigo custom field plugin which create the custom thread field as well as store it in the database as well. :)

Thanks.
 
Top