We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8164
    • 51 Posts
    I have been using a system for page-specific metatags on my early MODx sites that works like this:

    I create a Chunk: {{metaTags}}
    The Chunk has the following content:

    <link rel="shortcut icon" href="/favicon.ico" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta name="Description" content="[*metaDescription*]" />
    <meta name="Keywords" content="[*metaKeywords*]" />


    Then, I create Template Variables as called in the Chunk: metaDescription, etc.
    I give it the Input Type: Textarea (Mini) with no default value and assign it to the templates used in the public part of the site.

    Then, as I go through the site, I can use the QuickEdit floating toolbar to open Textarea editing windows on each page and put in descriptions and keywords while I’m actually looking at the page and it’s content.

    This has worked like a charm right up until the current site I’m building. Now, when I open the Textarea window to edit the metatag content, I get the following error every time I try to save:

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database failed - Table ’db158115611.modx_’ doesn’t exist »
    SQL: UPDATE modx_ SET editedon=’’,editedby=’1146767221’ WHERE id = ’1’;
    [Copy SQL to ClipBoard]

    Parser timing
    MySQL: 0.0029 s s (4 Requests)
    PHP: 1146767221.6646 s s
    Total: 1146767221.6676 s s


    If I create a default value in the Resource manager, that works fine, but I do this in order to edit metatags on the frontend...so that doesn’t solve the problem. All the other content editors work fine (Document Content, etc), it’s only the new TVs I create in the Resource Manager that do this. I don’t seem to have any other problem with SQL queries (which is what the error message references) in any other function on the site. I’ve repaired the MySQL tables, checked all my settings, etc. and find no problems.

    The only differences between this site and the ones that are working is that this site throwing the error is running 092. The others are running 091.

    Any ideas? I’ve done/checked everything I can think of, so I’m wondering if 0.9.2 has a bug in new TVs.

    Thanks!
    Duane
      • 6823
      • 6 Posts
      Hello,

      I’ve got exactly the same error. After searching, I’ve found the reasons.

      1. a bug in assets/modules/quick_edit/editor.class.inc.php (the name of table has been forgotten)

      around line 309, replace :

      $modx->db->update(array(’editedon’=>$now, ’editedby’=>$time), "{$pre}", "id = ’{$doc_id}’");
      //with
      $modx->db->update(array(’editedon’=>$now, ’editedby’=>$time), "{$pre}site_tmplvar_contentvalues", "id = ’{$doc_id}’");

      2. this line is supposed to update two fields editedon and editedby but they don’t exists in the table "modx_site_tmplvar_contentvalues" so you have to add them manually (int(20) and int(10) with null allowed) , then it works fine !

      Please keep me in touch.

      do you know how to share this bug solution with official support ? thank you

        • 10487 MODX Staff
        • 1,535 Posts
        Nice catch! You can log a bug here: http://modxcms.com/bugs/
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com
          • 8164
          • 51 Posts
          1. a bug in assets/modules/quick_edit/editor.class.inc.php (the name of table has been forgotten)

          around line 309, replace :

          $modx->db->update(array(’editedon’=>$now, ’editedby’=>$time), "{$pre}", "id = ’{$doc_id}’");
          //with
          $modx->db->update(array(’editedon’=>$now, ’editedby’=>$time), "{$pre}site_tmplvar_contentvalues", "id = ’{$doc_id}’");

          2. this line is supposed to update two fields editedon and editedby but they don’t exists in the table "modx_site_tmplvar_contentvalues" so you have to add them manually (int(20) and int(10) with null allowed) , then it works fine !

          dcontact...
          Excellent, excellent catch!!

          The solution you outline above works perfectly. Thank you so much!

          Duane
            • 20751
            • 122 Posts
            Just applied this and it works! Thanks so much!

            One thing . . . even though the editedon and by fields have been added to the table as described above, nothing actually get’s updated. Has anyone else found that to be the case or is it just me?

            Is it perhaps something for a future version that hasn’t been implemented yet?

            Thanks again for the fix! Saved me lots of grief!! grin


            EDIT:
            To be clear, when I said "nothing actually get’s updated" I’m referring to the editedon and editedby fields - the rest of the fields in the table get updated as normal.
              • 10487 MODX Staff
              • 1,535 Posts
              Just for future reference, dcontact has added this to the bugtracker as bug #376
                Garry Nutting
                Senior Developer
                MODX, LLC

                Email: [email protected]
                Twitter: @garryn
                Web: modx.com
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                I used this file, and couldn’t get an installation. Probably something to do with different versions of mysql, although there were no error messages, in fact the install went along reporting success until it tried to start inserting modules and snippets; the tables were never actually created. I switched back to the original files and all went well as usual.
                  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
                  • 17705
                  • 501 Posts
                  after adding that two columns to the table... modx store something there?

                  its always null...
                    • 6726
                    • 7,075 Posts
                    Quote from: dcontact at May 04, 2006, 04:32 PM
                    Please keep me in touch.

                    Thanks a lot for this !

                    Solves it for me smiley
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l&#39;outil id
                      • 3022
                      • 59 Posts
                      Quote from: dcontact at May 04, 2006, 04:32 PM

                      1. a bug in assets/modules/quick_edit/editor.class.inc.php (the name of table has been forgotten)

                      around line 309, replace :

                      $modx->db->update(array(’editedon’=>$now, ’editedby’=>$time), "{$pre}", "id = ’{$doc_id}’");
                      //with
                      $modx->db->update(array(’editedon’=>$now, ’editedby’=>$time), "{$pre}site_tmplvar_contentvalues", "id = ’{$doc_id}’");

                      2. this line is supposed to update two fields editedon and editedby but they don’t exists in the table "modx_site_tmplvar_contentvalues" so you have to add them manually (int(20) and int(10) with null allowed) , then it works fine !

                      Great! This worked for me, too. Thanks a lot.

                      Since I have now extended my site_tmplvar_contentvalues tables, will this be a problem when I upgrade to 0.9.5/1.0?


                      Bee