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

    On a client site (evo 1.1.13) with Pubkit i Have a strange error when publishing.

    « MODX Parse Error »
    MODX encountered the following error while attempting to parse the requested resource:
    « Empty $from parameters in DBAPI::select(). »
    Basic info
    REQUEST_URI : 	http://www.domain.it/area-utente/form-inserzione.html
    Resource : 	[96]Inserisci Ditta Traslochi
    Current Snippet : 	PubKit
    Referer : 	http://www.domain.it/area-utente/form-inserzione.html
    User Agent : 	Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36
    IP : 	94.39.3.160
    Benchmarks
    MySQL : 	0.0098 s (63 Requests)
    PHP : 	0.0625 s
    Total : 	0.0723 s
    Memory : 	3.4278793335 mb
    
    Backtrace
    1	DocumentParser->executeParser()
    index.php on line 144
    2	DocumentParser->prepareResponse()
    manager/includes/document.parser.class.inc.php on line 1598
    3	DocumentParser->outputContent()
    manager/includes/document.parser.class.inc.php on line 1699
    4	DocumentParser->parseDocumentSource()
    manager/includes/document.parser.class.inc.php on line 591
    5	DocumentParser->evalSnippets()
    manager/includes/document.parser.class.inc.php on line 1480
    6	DocumentParser->_get_snip_result()
    manager/includes/document.parser.class.inc.php on line 1079
    7	DocumentParser->evalSnippet()
    manager/includes/document.parser.class.inc.php on line 1166
    8	eval()
    manager/includes/document.parser.class.inc.php on line 1027
    9	require_once()
    manager/includes/document.parser.class.inc.php(1027) : eval()'d code on line 223
    10	resetRank()
    assets/snippets/pubKit/pubKit.inc.php on line 233
    11	DBAPI->select()
    assets/snippets/pubKit/pubKit.functions.php on line 103


    seems related to the function resetRank, but can't understand
      Free MODx Graphic resources and Templates www.tattoocms.it
      -----------------------------------------------------

      MODx IT  www.modx.it
      -----------------------------------------------------

      bubuna.com - Web & Multimedia Design
      • 16278
      • 928 Posts
      The message appears to be due to a change in MODX 1.0.13. In earlier versions, the statement
      	$next = $modx->db->select('@rank');

      on line 103 of pubKit.functions.php would have come back as false because no table is given as the "from" parameter; now it exits with the error message "Empty $from parameters in DBAPI::select()."

      I don't have any sites with MODX 1.0.13 (I now work with Clipper rather than MODX), so cannot test, but as far as I can tell using text searches in other PubKit installs, the return value from resetRank is not used anywhere. So you could try commenting out the line, and setting "return false;" or just "return;" at the end of the function.

      Alternatively, it seems you could keep the DBAPI happy by supplying the dummy table name DUAL (not tested; see https://dev.mysql.com/doc/refman/5.5/en/select.html):
      	$next = $modx->db->select('@rank', 'DUAL');

      :) KP
        • 2762
        • 1,198 Posts
        I suspected it was a problem with latest evo relase, because I have Pubkit without issue in a a couple of previous modx installation.
        I will try your modification tomorrow.

        Thank you very much for quick help and for this great snippet - for me - the best front end editor form evo/clipper

        take this opportunity to ask you a question.
        How do you send the 'webuser author' in the form input post?

        I use a combination of TV and snippet to get webuser author of the post

        1) an "author" tv
        2) a snippet "Username" with code
        <?php
        $user = $modx->getLoginUserName();
        if ($user) {
          return  $user;
        } else {
        }
        ?>



        3) in the input form
        <input type="text" class="medium" name="author" id="author" value="[[Username]]" readonly>
          Free MODx Graphic resources and Templates www.tattoocms.it
          -----------------------------------------------------

          MODx IT  www.modx.it
          -----------------------------------------------------

          bubuna.com - Web & Multimedia Design
          • 2762
          • 1,198 Posts
          Quote from: kp52 at May 06, 2014, 07:32 PM
          The message appears to be due to a change in MODX 1.0.13. In earlier versions, the statement
          	$next = $modx->db->select('@rank');

          on line 103 of pubKit.functions.php would have come back as false because no table is given as the "from" parameter; now it exits with the error message "Empty $from parameters in DBAPI::select()."
          ....So you could try commenting out the line, and setting "return false;" or just "return;" at the end of the function.

          This solution works for me with evo 1.0.14
          Thank you very much smiley
            Free MODx Graphic resources and Templates www.tattoocms.it
            -----------------------------------------------------

            MODx IT  www.modx.it
            -----------------------------------------------------

            bubuna.com - Web & Multimedia Design