We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10795
    • 38 Posts
    I reinstalled Discuss a few times earlier today FRESH and each time, the following error after hitting the 'modify' button on messages (PMs). I tested on my official MODX PM message and it works fine. Any help appreciated.

    Fatal error: Class 'disThread' not found in

    [..]/core/components/discuss/controllers/web/messages/modify.class.php on line 44

    $this->thread = $this->modx->call('disThread', 'fetch', array(&$this->modx,$this->post-
     
    >get('thread'),disThread::TYPE_MESSAGE));
            if (empty($this->thread)) $this->discuss->sendErrorPage();
            $this->modx->lexicon->load('discuss:post');
    

    This question has been answered by mintnl. See the first response.

      • 10795
      • 38 Posts
      I'm guessing this parameter trying to call TYPE_MESSAGE is not working... Any idea where to check on this?

      disThread::TYPE_MESSAGE

        • 10795
        • 38 Posts
        I'm guessing this parameter trying to call TYPE_MESSAGE is not working... Any idea where to check on this?

        disThread::TYPE_MESSAGE

        Seems like this from testing is the #1 critical bug as far as error shooting on the front-end and forum functionality for messaging. I saw on the bug-tracker relating issues going back to 2011-2012.

        I would like to know from someone experienced if in fact this is related to the current modx versions as far as compatibility, and if the modx install of Discuss for this actual forum is resting on an older modx version or current. It would help greatly I think if modx developers would comment.

        Thanks.

        • discuss.answer
          • 38705
          • 101 Posts
          Hi giantcarrot,

          I stumbled upon this problem too, while redesigning a website with discuss in use.
          Because of the many parts and chucks i started to redesign the layout step by step. So i also came across messages/modify, because it never has been used up to date no one has noticed the failure. So i started a little comparison with some other class files and i noticed that the line
          if (!class_exists('disThread')) { $this->modx->loadClass('disThread'); }

          was present in messages/reply.class.php and not in messages/modify.class.php. So i quickly pasted this line into the modify class and Whoomp There It Is!

          It 's working without errors. So add the above line to the modify.class.php so it looks like:
              public function initialize() {
                  $post = $this->getProperty('post',false);
                  if (empty($post)) { $this->modx->sendErrorPage(); }
                  $this->post = $this->modx->getObject('disPost',$post);
                  if (empty($this->post)) { $this->discuss->sendErrorPage(); }
          
                  $this->discuss->setPageTitle($this->modx->lexicon('discuss.modify_post_header',array('title' => $this->post->get('title'))));
                  if (!class_exists('disThread')) { $this->modx->loadClass('disThread'); }
                  $this->thread = $this->modx->call('disThread', 'fetch', array(&$this->modx,$this->post->get('thread'),disThread::TYPE_MESSAGE));
                  if (empty($this->thread)) $this->discuss->sendErrorPage();
                  $this->modx->lexicon->load('discuss:post');
              }


          Hope it helped you, still after 11 months....
            Addict since 2012....
            • 46886
            • 1,154 Posts
            Hi giantcarrot:

            I think I gave you some trouble before, if so I apologize. As I remember you put up a bunch of messages and I got frustrated, its my error, sorry for it. Its funny because I am definitely the type to post a bunch of messages at once when i get focused on something, but I got mad when you did the same thing. I got defensive and shouldn't have.

            I never saw this bug at all but you two have fixed it together, great work. If gc didn't take the time to provide detailed issue info then mintnl maybe won't reply with the clear fix. Thanks to you both.

             if the modx install of Discuss for this actual forum is resting on an older modx version or current. It would help greatly I think if modx developers would comment.


            I think I can answer this question for you, its info I didn't know a year ago.

            Yes, I believe the Modx version of this forum is older, and I believe there are at least some upgrade issues involved, however the bigger issues are the transfer of a huge amount of forum data to a new install. This install of Discuss is probably an earlier version than what we have in the repos, a custom version. So, there are issues with upgrading this one (in addition to the size of the data) that are special and can't be planned for easily.

            However, I am running Discuss on Revo 2.2.14 right now, and there are reports that it can run fine on even newer versions of Revo. I am just lazy about upgrading. I am not saying upgrading is painless but it should be possible, in fact I should do that soon. So I feel Discuss is still quite viable, even with all the annoying bugs. However, the bugs will never be fixed, we can only make work-arounds ourselves.

            Discuss itself isn't in development anymore, and Discuss2 (alpha) has been released to the community recently, as the Modx team has more important work to do. Petri (I think) did most or all of the coding of D2, and it apparently makes every thread into a resource, which will solve a lot of problems (the nested nature of the pages of Discuss make pulling out data for facebook etc. difficult). I guess he would have done that work just about a year and a half ago from now. Here are the repos: https://github.com/modxcms/discuss2

            So far no one has picked up on it, one dev user said he would look at it eventually, but there has been no progress so far.

            As for me, I still think Discuss is a great solution, despite the bugs. Recently I was able to customize sidebars for different categories of the site, which will allow me to customize adverts based on subject, language or whatever. Take that, Vanilla!

            I am hopeful D2 will get some attention eventually, right now we don't even know whether it is working or not. I am not a developer but will do whatever testing is needed and can dig into lots of issues, could make an install guide, whatever. And my friend can help get a test install up and working on the server, or at least we can try.