I need in my topic new input field, i added it in template file and in the database #__kunena_topics, in controllers topic.php i added it also to function post() but if i save topic my custom field value is not saved in db, name field has true name etc... are there still files where i must get value from my custom field?

in the controller file i added this field: /components/com_kunena/controllers/topic.php

public function post() {
    $this->id = JRequest::getInt('parentid', 0);
    $fields = array (
        'catid' => $this->catid,
        'name' => JRequest::getString ( 'authorname', $this->me->getName () ),
        'email' => JRequest::getString ( 'email', null ),
        'subject' => JRequest::getVar ( 'subject', null, 'POST', 'string', JREQUEST_ALLOWRAW ),
        'message' => JRequest::getVar ( 'message', null, 'POST', 'string', JREQUEST_ALLOWRAW ),
        'icon_id' => JRequest::getInt ( 'topic_emoticon', null ),
        'anonymous' => JRequest::getInt ( 'anonymous', 0 ),
        'poll_title' => JRequest::getString ( 'poll_title', '' ),
        'poll_options' => JRequest::getVar('polloptionsID', array (), 'post', 'array'),
        'poll_time_to_live' => JRequest::getString ( 'poll_time_to_live', 0 ),
        'tags' => JRequest::getString ( 'tags', null ),
        'mytags' => JRequest::getString ( 'mytags', null ),
        'subscribe' => JRequest::getInt ( 'subscribeMe', 0 ),
        'crmusername' => JRequest::getVar ('crmusername', null)
  • If you're using Joomla 3.x then please bare in mind that JRequest is deprecated. – Lodder Jun 22 '14 at 21:46
  • Be aware, you can't update Kunena to a newest version anymore. – Anibal Jun 23 '14 at 12:12

It's better if you extend Kunena through a view override and save the new information with a Kunena plugin.

About Component View Override: http://docs.joomla.org/Understanding_Output_Overrides#Component_Output_Types_and_Layout_Overrides

About Kunena plugins: examples http://www.kunena.org/docs/Kunena_Add-ons TIP: onKunenaAfterSave

protected by Community Feb 19 '15 at 15:54

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.