We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24278
    • 165 Posts
    Hi Members,

    In the "Preview Window" below the "Page Data" box in the Modx Manager Interface (0.9.2) (for each document), I get the following error (if the document is not published) instead of the preview of the page.

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 »
          SQL: SELECT fullname FROM `rnitu_archipage`.modx_user_attributes WHERE `rnitu_archipage`.modx_user_attributes.id =
          [Copy SQL to ClipBoard]
     
    Parser timing
      MySQL: 	0.0132 s s	(5 Requests)
      PHP: 	0.0535 s s	 
      Total: 	0.0667 s s


    Please can someone advice me on rectifying the same.

    warm regards

    Raavi
      • 4041
      • 788 Posts
      This happens because the preview window is an iframe which shows the atual page from the site. If it unpublished then it will not show.

      A workaround to this is to have a staging folder set up which is unpublished and then create the document, set it as published with the parent as the unpublished staging folder. Then once your edits are complete change the parent of the document to where the actual location will be.
        xforum
        http://frsbuilders.net (under construction) forum for evolution
        • 24278
        • 165 Posts
        That was fast. Thanks breezer.

        Raavi.
          • 7923
          • 4,213 Posts
          There shouldn’t be any error in the preview window even when the document is unpublished. If you are logged in to the manager, you should see all documents in the preview, no matter are they unpublished or published.

          There’s something going on with your modx installation..


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 4041
            • 788 Posts
            my apologies Raavi, I made an assumption based on prior knowledge... I did not mean to lead you astray so from now on I won’t post unless I’m pretty sure I know what I’m talking about... huh
              xforum
              http://frsbuilders.net (under construction) forum for evolution
              • 6778
              • 20 Posts
              I had the same problem. Do you use the MetaTagsExtra-Snippet?

              There ist something wrong with it. I added a "if($authoerid != "") and it works. But I don’t know why wink
              if($authorid != "" ) {
              
              $tbl = $modx->getFullTableName("user_attributes");
              $query = "SELECT fullname FROM $tbl WHERE $tbl.id =abs($authorid)";
              
              $rs = $modx->dbQuery($query);
              $limit = $modx->recordCount($rs); 
              if($limit=1) {
                $resourceauthor = $etomite->fetchRow($rs); 
                $authorname = $resourceauthor['fullname'];  
              }
              if (!$authorname == ""){
                $MetaAuthor = " <meta name=\"author\" content=\"$authorname\" />\n";
                $MetaCopyright = " <meta name=\"copyright\" content=\"Copyright (c) $createdon by $authorname. All rights reserved.\" />\n";
              }
              
              }
              //if($authorid != "" ) {



              Currently I switched from MetaTagsExtra to a selfmade snippet (MetaTags2 wink )
                • 24278
                • 165 Posts
                Thanks dazze. Seems to work.

                Raavi