We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29079
    • 1 Posts
    Since a couple of days I am trying to connect SMF and MODx now, but with no success. Whenever I try to install the SMF Connector, I get the following:

    -------------------------------
    Setup will now attempt to setup the database:

    Creating connection to the database: OK!

    Selecting database `db242145030`: OK!

    Module:

    SMF Connector: Installed

    Plugin:

    SMFConnect: Installed

    Fatal error: Call to a member function on a non-object in /homepages/30/d21738470/htdocs/test/manager/processors/cache_sync.class.processor.php on line 100
    ----------------------------------------

    I tried this on two webservers and on my own computer with XAMPP now but I always get the same issue. But I have read that it should work (http://modxcms.com/forums/index.php/topic,14143.0.html)

    Does someone has an idea how to solve this problem? I use MODx 0.9.6.3 and SMF 1.1.10

    I am relatively new to this, maybe it is only a typical beginner’s issue?
      • 28230
      • 4 Posts
      I get the same thing on Line 107.

      I have seached all over and have not been able to get this resolved.

      Did you have any luck?

      Setup will now attempt to setup the database:

      Creating connection to the database: OK!

      Selecting database `user_modx`: OK!

      Module:

      SMF Connector: Upgraded

      Plugin:

      SMFConnect: Upgraded


      Fatal error: Call to a member function getFullTableName() on a non-object in /home/user/public_html/modx/manager/processors/cache_sync.class.processor.php on line 107
      • That sounds like somebody forgot the global $modx line in a function in the connector script.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 28230
          • 4 Posts
          Ok - Im new to this but I will bite. I did notice that "global $modx" is defined in my script that is causing the error and looks like this.

          global $modx;

          $tmpPHP = "<?php\n";

          // SETTINGS & DOCUMENT LISTINGS CACHE

          // get settings
          $sql = ’SELECT * FROM ’.$modx->getFullTableName(’system_settings’);
          $rs = $modx->db->query($sql);
          $limit_tmp = $modx->db->getRecordCount($rs);
          $config = array();
          $tmpPHP .= ’$c=&$this->config;’."\n";
          while(list($key,$value) = $modx->db->getRow($rs,’num’)) {
          $tmpPHP .= ’$c[\’’.$key.’\’]’.’ = "’.$this->escapeDoubleQuotes($value)."\";\n";
          $config[$key] = $value;
          }

          Should I be looking for it somewhere else?
            • 21395
            • 91 Posts
            I have the same Fatal Error.

            I run, for this site, Evolution 1.0, PHP5.2.5, MySQL 4.1.22.

            I want to run SMF 1.1.10, it is installed, and I have set up and run SMF Connector 1.0

            The installation offers a choice or both or none of Module and Plugin (but doesn’t say which variations are appropriate), but no matter what one chooses, it always abends with:

            Setup will now attempt to setup the database:

            Creating connection to the database: OK!

            Selecting database `boyde_ccd`: OK!

            Module:

            SMF Connector: Upgraded

            Plugin:

            SMFConnect: Upgraded

            Fatal error: Call to a member function getFullTableName() on a non-object in /home/boyde/public_html/ccd/manager/processors/cache_sync.class.processor.php on line 107


            Line 107 is:

            $sql = 'SELECT * FROM '.$modx->getFullTableName('system_settings');


            The error reported is odd: as previously reported, the piece of script being called includes "global $modx", and I’ve checked to see if there is anything wrong with my system_settings table, but it looks fine. My database table-names do include a table-prefix, and I can’t see anything in the code that deals with prefixes, so this might be a clue.

            In any event, the class being called, is called by the almost-last step of instprocessor.php:

            // always empty cache after install
            include_once "../manager/processors/cache_sync.class.processor.php";
            $sync = new synccache();
            $sync->setCachepath("../assets/cache/");
            $sync->setReport(false);
            $sync->emptyCache(); // first empty the cache
            


            So I’ve cheerfully ignored it, closed down the browser, re-opened it and logged back in. Cache cleared, no?

            The issue niggles though, because it doesn’t happen to a friend who has an identical set-up to me - on the face of it. (Apart from Database table prefixes: he doesn’t have any).

            It niggles even more because I also get the:

            Fatal error: Call to undefined function smf_loginbyid() in /home/boyde/public_html/ccd/assets/modules/smforum/smf.admin.class.inc.php on line 36

            error when clicking on the Administration Center button, and the:

            Fatal error: Call to undefined function smf_registermember() in /home/boyde/public_html/ccd/assets/modules/smforum/smf.sync.class.inc.php on line 114

            error when clicking on Synchronize Users button, both in the SMF Connector Module.

            Both these errors have been reported before, but no satisfactory response or solution seems to have been found.

            I’ve checked the first instance: there is a function called smf_LoginById() in the smf.admin.class.inc.php file (NB Capitals). The Module code doesn’t make this call, and the Plugin code makes it correctly. Is the error message telling the truth? Is the call non-capitalised? I don’t know where the call is coming from yet. Do Caps matter? I always thought they did.

            The second instance is similar - the class file has a function smf_registerMember with a capital M. The module code doesn’t use, and the Plugin code uses it correctly.


            In the first case Line 36 in the admin class file is near the top of the documentation.

            Line 36 in the plugin file is in fact a blank line in the middle of a MD5 hashing routine.

            In the second case Line 114 is also in the documentation of the sync class file, and Line 114 in the Plugin is a table name declaration.

            So the line numbers don’t match the likely calling program or the included class, but all you real programmers out there will doubtless know all about this. Pity I don’t.


            The only clue I have is that prefixes might be at the root of this, because of the failure of the cache-clearing in initial set-up.



            All I want to do is have a forum that looks like it is inside my MODx site, and if you are logged in to the site, you can hop straight into the forum.

            I’m stuck.



            Nic Boyde
              MODX Revolution 2.6.5-pl (traditional)

              Hosted on MODX Cloud

              Skype: nicbaldeagle
              • 21395
              • 91 Posts
              I’ve just tried to install SMF and SMF Connector on another site of mine, where, as it happens, the MODx database has no prefixes.

              The Connector installation did not fail with the Line 107 error at cache clean-up time.

              Now to see if the Admin and Synch functions work...
                MODX Revolution 2.6.5-pl (traditional)

                Hosted on MODX Cloud

                Skype: nicbaldeagle
                • 21395
                • 91 Posts
                Nope.

                But at least I’ve found out why the basic install seems to fail.


                Don’t have a db with table-name prefixes.
                  MODX Revolution 2.6.5-pl (traditional)

                  Hosted on MODX Cloud

                  Skype: nicbaldeagle
                  • 21395
                  • 91 Posts
                  Now solved. Way back in 2006 someone from France suggested extracting the content of the smf_api_1.1.php file and saving it in a new file with the same name and uploading it. This seems to unscramble it, and it then works perfectly.
                    MODX Revolution 2.6.5-pl (traditional)

                    Hosted on MODX Cloud

                    Skype: nicbaldeagle
                    • 15768
                    • 2 Posts
                    So...just to be clear....how did you fix this? My tables have the modx_ prefix...

                    I’m also getting the 107 error...
                      • 21395
                      • 91 Posts
                      In short I didn’t bother to fix it.

                      The "107" error is due to the script not handling prefixes. If you table has a prefix, you get this "fatal error".

                      But it isn’t "fatal" at all - this portion of the script begins after the installation has successfully completed, whereupon the program goes on to empty the cache - pure housekeeping.

                      In fact your installation is fine. Got to the module and start the configuration as outlined in the documentation.

                      Of much more concern is the next two errors - these proved very hard to understand, but boiled down to the fact that the distributed smf api class file is (sometimes?) corrupt, and needs to be re-saved in plain text form and re-uploaded. Thereafter class calls succeed and your module begins to work.
                        MODX Revolution 2.6.5-pl (traditional)

                        Hosted on MODX Cloud

                        Skype: nicbaldeagle