We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36931
    • 206 Posts
    Hello
    I was angious doing this task. My provider propose me to migrate the platform to the last verison.
    I did it and first of view it goes well. The web site display well. But... I cna not go to manager :www.mywebsite.ch/manager

    I got the following error

    Fatal error: Uncaught Error: Call to a member function getMessage() on string in /home/clients/f3d642a7c5a87f00a6a9dcdadfa35d7a/web/core/model/modx/modmanagercontroller.class.php:617 Stack trace: #0 /home/clients/f3d642a7c5a87f00a6a9dcdadfa35d7a/web/core/model/modx/modmanagercontroller.class.php(556): modManagerController->getDefaultState() #1 /home/clients/f3d642a7c5a87f00a6a9dcdadfa35d7a/web/core/model/modx/modmanagercontroller.class.php(137): modManagerController->registerBaseScripts() #2 /home/clients/f3d642a7c5a87f00a6a9dcdadfa35d7a/web/core/model/modx/modmanagerresponse.class.php(74): modManagerController->render() #3 /home/clients/f3d642a7c5a87f00a6a9dcdadfa35d7a/web/core/model/modx/modmanagerrequest.class.php(183): modManagerResponse->outputContent(Array) #4 /home/clients/f3d642a7c5a87f00a6a9dcdadfa35d7a/web/core/model/modx/modmanagerrequest.class.php(131): modManagerRequest->prepareResponse() #5 /home/clients/f3d642a7c5a87f00a6a9dcdadfa35d7a/web/manager/index.php(58): modManagerRequest->handleRequest() #6 {main} in /home/clients/f3d642a7c5a87f00a6a9dcdadfa35d7a/web/core/model/modx/modmanagercontroller.class.php on line 617

    I absolutely no idea from where I have to start to investigate.
    Is a permission issue on a file?
    I hesitate to run www.mywebsite.ch/setup/, but I am afaraid to lost the content of my database.
    Would it possible to reinstall modx keep the database content?

    Where can I get my default template from the database?

    Cheers
    Pierre

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

    [ed. note: pierrot1010 last edited this post 5 years, 6 months ago.]
      • 36931
      • 206 Posts
      I ran www.mywebsite.ch/setup/ and I chosed to update the installation.
      Now when I got to manager, I got that error message

      Fatal error: Uncaught --> Smarty: Unable to load template 'file:header.tpl' <-- thrown in /home/clients/f3d642a7c5a87f00a6a9dcdadfa35d7a/web/core/model/smarty/sysplugins/smarty_internal_template.php on line 185

      Thank for helping!!
        • 3749
        • 24,544 Posts
        The first thing to try is manually deleting all files in the core/cache directory and clearing your browser cache and cookies.

        What version did you upgrade from?

          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 36931
          • 206 Posts
          Quote from: BobRay at Oct 16, 2018, 10:27 PM
          The first thing to try is manually deleting all files in the core/cache directory and clearing your browser cache and cookies.

          What version did you upgrade from?

          Dear Bob
          Thank fro your reply.
          I did it. I cleared the cache folders.
          In fact, I have not upgrade the version because 2.6.5 was already install, but I reinstall it, and I choose the upgrade version (second option) instead of the clean install (first option).

          The MODx database contain all setting, pages, template and I do not want to lose it. How cn I reinstall MODX with the actual database?

          Cheers
            • 3749
            • 24,544 Posts
            Take a look at that file: /home/clients/f3d642a7c5a87f00a6a9dcdadfa35d7a/web/core/model/smarty/sysplugins/smarty_internal_template.php

            If it contains any suspicious JavaScript code (lists of comma-separated decimal or hexadecimal numbers), it's likely that your site has been hacked. There was an attack a while ago that targeted this file:

            home/clients/web/public_html/manager/templates/default/header.tpl.

            Take a look at that one too.

            It's also possible that that file is just corrupted, especially if the MODX files were transferred individually with FTP.

            If you post any code from those files, be sure to leave enclose it in code tags (highlight it and click on the <> button in the message menu here) before saving it.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 36931
              • 206 Posts
              Quote from: BobRay at Oct 17, 2018, 06:41 PM
              Take a look at that file: /home/clients/f3d642a7c5a87f00a6a9dcdadfa35d7a/web/core/model/smarty/sysplugins/smarty_internal_template.php

              If it contains any suspicious JavaScript code (lists of comma-separated decimal or hexadecimal numbers), it's likely that your site has been hacked. There was an attack a while ago that targeted this file:

              home/clients/web/public_html/manager/templates/default/header.tpl.

              Take a look at that one too.

              It's also possible that that file is just corrupted, especially if the MODX files were transferred individually with FTP.

              If you post any code from those files, be sure to leave enclose it in code tags (highlight it and click on the <> button in the message menu here) before saving it.

              Hello Bob,
              I already re-uploaded all subfolders and file of core/model/smarty/
              I did the same for manager/templates/default/

              Here is the code where the error is generated
              // checks if template exists
                      if (!$this->source->exists) {
                          throw new SmartyException("Unable to load template '{$this->source->type}:{$this->source->name}'" .
                                                    ($this->_isSubTpl() ? " in '{$this->parent->template_resource}'" : ''));
                      }
              

              and header.tpl has the following
              <!DOCTYPE html>
              <html xmlns="http://www.w3.org/1999/xhtml" dir="{$_config.manager_direction}" lang="{$_config.manager_lang_attribute}" xml:lang="{$_config.manager_lang_attribute}">
              <head>
              <title>{if $_pagetitle}{$_pagetitle} | {/if}{$_config.site_name|strip_tags|escape}</title>
              <meta http-equiv="Content-Type" content="text/html; charset={$_config.modx_charset}" />
              <meta name="viewport" content="width=device-width, initial-scale=1" />
              
                  {if $_config.manager_favicon_url}<link rel="shortcut icon" href="{$_config.manager_favicon_url}" />{/if}
              
              <link rel="stylesheet" type="text/css" href="{$_config.manager_url}assets/ext3/resources/css/ext-all-notheme-min.css" />
              <link rel="stylesheet" type="text/css" href="{$indexCss}?v={$versionToken}" />
              
              {if isset($_config.ext_debug) && $_config.ext_debug}
              <script src="{$_config.manager_url}assets/ext3/adapter/ext/ext-base-debug.js" type="text/javascript"></script>
              <script src="{$_config.manager_url}assets/ext3/ext-all-debug.js" type="text/javascript"></script>
              {else}
              <script src="{$_config.manager_url}assets/ext3/adapter/ext/ext-base.js" type="text/javascript"></script>
              <script src="{$_config.manager_url}assets/ext3/ext-all.js" type="text/javascript"></script>
              {/if}
              <script src="{$_config.manager_url}assets/modext/core/modx.js?v={$versionToken}" type="text/javascript"></script>
              <script src="{$_config.connectors_url}lang.js.php?ctx=mgr&topic=topmenu,file,resource,{$_lang_topics}&action={$smarty.get.a|default|htmlspecialchars}" type="text/javascript"></script>
              <script src="{$_config.connectors_url}modx.config.js.php?action={$smarty.get.a|default|htmlspecialchars}{if $_ctx}&wctx={$_ctx}{/if}" type="text/javascript"></script>
              
              {$maincssjs}
              {foreach from=$cssjs item=scr}
              {$scr}
              {/foreach}
              
              <script type="text/javascript">
                  Ext.onReady(function() {
                      // Enable site name tooltip (on overflow only)
                      if( Ext.get('site_name').dom.scrollWidth > Ext.get('site_name').dom.clientWidth ){
                        new Ext.ToolTip({
                            title: Ext.get('site_name').dom.title
                            ,target: Ext.get('site_name')
                        });
                      }
                      {if $_search}
                      new MODx.SearchBar;
                      {/if}
                  });
              </script>
              
              </head>
              <body id="modx-body-tag">
              
              <div id="modx-browser"></div>
              <div id="modx-container">
                  <div id="modx-header">
                      <div id="modx-navbar">
                          <ul id="modx-user-menu">
                              {* eval is used here to support nested variables *}
                              {eval var=$userNav}
                          </ul>
              
                          <ul id="modx-topnav">
                              <li id="modx-home-dashboard">
                                  <a href="?" title="MODX {$_config.settings_version} ({$_config.settings_distro})
              {$_lang.dashboard}">{$_lang.dashboard}</a>
                              </li>
                              <li id="modx-site-info">
                                  <div id="site_name" class="info-item site_name" title="{$_config.site_name|strip_tags|escape}">{$_config.site_name|strip_tags|escape}</div>
                                  {* TODO: Pull full_appname from docs/version.inc.php ? *}
                                  <div class="info-item full_appname">MODX Revolution {$_config.settings_version}</div>
                              </li>
                              {if $_search}
                              <li id="modx-manager-search-icon">
                                  <a href="javascript:;" onclick="Ext.getCmp('modx-uberbar').toggle()" title="{$_lang.search}">
                                      <span class="icon-stack icon-lg">
                                        <i class="icon icon-square icon-stack-2x"></i>
                                        <i class="icon icon-search icon-stack-1x"></i>
                                      </span>
                                  </a>
                              </li>
                              {/if}
                              {eval var=$navb}
                          </ul>
                          {if $_search}
                          <div id="modx-manager-search" role="search"></div>
                          {/if}
                      </div>
                  </div>
                      <div id="modAB"></div>
                      <div id="modx-leftbar"></div>
                      <div id="modx-action-buttons-container"></div>
                      <div id="modx-content">
                          <div id="modx-panel-holder"></div>
              
              

              Today, I observed someting strange with my /core/conf/config.inc.php

              For example the following
              if (!defined('MODX_MANAGER_PATH')) {
                  //$modx_manager_path= '/home/www/abc91d3da1aaa8a5963ba021a1b7842d/web/manager/';
                  $modx_manager_path= '/home/www/f3d642a7c5a87f00a6a9dcdadfa35d7a/web/manager/';
                  $modx_manager_url= '/manager/';
                  define('MODX_MANAGER_PATH', $modx_manager_path);
                  define('MODX_MANAGER_URL', $modx_manager_url);
              }


              As apprently, my root folder has been moved from the web server, this

              abc91d3da1aaa8a5963ba021a1b7842d
              change to

              f3d642a7c5a87f00a6a9dcdadfa35d7a
              For some of them, I had to change manuelly as above.

              Do you think, my config file may be like corrupt?
              It's the reason why, I am thinking to reinstall my MODx, but I am afraid losing my database content.
              How to you suggest me to do it and preserving my database?
              I could copy ma database (modx to modx_copy), make an new clean installed, rename my new fresh database (modx to modx_obso), and rename my copied database to the initial name (modx_copy to modx)? Would it works?
                • 3749
                • 24,544 Posts
                Those directory names are really odd. I've never seen that. Normally, they would be just /home/clientname/web/manager. Does your connectors path in config.inc.php match the manager path?

                I don't see anything suspicious in the files, but those directory names are a little suspicious.

                Is there anything in /home/clientname/web/ (e.g., core, manager, connectors directories)?

                On preserving your DB:

                If you have cPanel access, you can go into PhpMyAdmin and export your MODX database to a .sql file on your local machine. That will let you import it into any database. If you intend to import it into an existing MODX install, you'll want to select the DROP TABLE custom option for the export so the records won't be added to what's already there.

                Before you start messing with a new install, you might try this:

                Download a fresh version of MODX 2.6.5 from https://modx.com/download. Then follow the directions here to put the files in place: https://bobsguides.com/modx-upgrade-faq.html and run setup again. Delete all the core/cache files again after setup finishes and before logging in. I suggest this on the off chance that one or more of the files you have now is missing or corrupted.

                BTW, one possibility is that whoever upgraded the site skipped over one or more major versions of MODX (the ones ending in .0). Those are where the database gets updated, so the structure of your database may not be correct. It's worth checking to see if the fields mentioned here are in the DB: https://bobsguides.com/blog.html/2016/06/27/missing-db-fields-(unknown-column)/.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                • discuss.answer
                  • 36931
                  • 206 Posts
                  I solved my issue. A line was wrong in my /core/config/config.inc.php file

                  /home/www/
                  should be
                  /home/clients/
                    • 3749
                    • 24,544 Posts
                    I'm glad you got it sorted. Thanks for reporting back. smiley
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting