ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Partial Fix for Bug Report 15145

April 13, 2011 10:30pm

Subscribe [4]
  • #1 / Apr 13, 2011 10:30pm

    KenKodz

    25 posts

    This post references this bug report reported on 1/31/2011: https://support.ellislab.com/bugs/detail/15145/

    Specifically it provides a fix to:

    On top of that manually adding a Forum Topic ID does not stick.i.e if I save the entry the field is empty again.

    The cause of the problem is in the function function publish_data_db located at approximately line 190 of /system/expressionengine/modules/forum/tab.forum.php.

    The function checks to see if the Forum Title and Forum Body exists before trying to update any of the Forum Topic ID. If the Forum Topic ID is not initially set then it can never be set.

    The fix:

    At approximately line 196 there is the if statement below:

    if ((isset($params['mod_data']['forum_title'], $params['mod_data']['forum_body'],
                          $params['mod_data']['forum_id'])
                && $params['mod_data']['forum_title'] !== '' && $params['mod_data']['forum_body'] !== ''))
            {

    At the end of the if statement located at approximately line 270 add the following elseif statement:

    elseif (isset($params['mod_data']['forum_topic_id']) && $params['mod_data']['forum_topic_id'] != '')
            {
                $topic_id = $params['mod_data']['forum_topic_id'];
                $this->EE->db->where('entry_id', (int) $params['entry_id'])
                                 ->update('channel_titles', array('forum_topic_id' => (int) $topic_id));
            }

    This checks to see if the Forum Topic ID is set and if it is it will update it.

  • #2 / Apr 14, 2011 3:37pm

    Brandon Jones

    5500 posts

    Thanks Ken-at-Trinity. Do you mind posting that in the bug report? You can use code tags in there.

  • #3 / Apr 14, 2011 3:40pm

    KenKodz

    25 posts

    I am now getting reports of other “strangeness” after I updated my client’s forums. I need to go through the code to see if I missed something or if it is unrelated.

    Will update the thread with the results.

  • #4 / Apr 14, 2011 3:42pm

    Brandon Jones

    5500 posts

    Much appreciated, Ken.

  • #5 / Apr 14, 2011 6:55pm

    KenKodz

    25 posts

    Doesn’t look like the code changes caused the other issues my client had but at the same time I can’t reproduce the problems with my code addition.

    I did notice the following and am not sure that it is intended behavior:

    - If you have an article that is linked via a Forum Topic ID and you delete the Forum Topic ID (field is left blank) and you don’t delete the Forum Topic Title, it will create a new forum topic and link the article to it.

    - If you want to remove a linked forum then you should enter 0 in the Forum Topic ID

    I will post the code to the bug report in a few.

  • #6 / Apr 15, 2011 9:23am

    moogaloo

    200 posts

    That’s great - fixed the forum - channel linking bug

  • #7 / Apr 17, 2011 2:05pm

    Greg Salt

    3988 posts

    Hi Ken,

    - If you have an article that is linked via a Forum Topic ID and you delete the Forum Topic ID (field is left blank) and you don’t delete the Forum Topic Title, it will create a new forum topic and link the article to it.

    - If you want to remove a linked forum then you should enter 0 in the Forum Topic ID

    I believe that is intended behaviour. Thanks for updating the bug report. Which other errors was your client getting?

    @moogaloo,

    Excellent. Thanks for the validation.

    Cheers

    Greg

  • #8 / Apr 17, 2011 2:11pm

    KenKodz

    25 posts

    There was some corruption of data that I had to clean up. Everything is working fine now.

  • #9 / Apr 17, 2011 2:21pm

    Greg Salt

    3988 posts

    Hi Ken,

    In that case I’m going to close this thread. Please open a related one if required. Thanks again for your help with the bug.

    Cheers

    Greg

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases