We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14616
    • 3 Posts
    Hallo all

    i’ve got a question or maybe an error, that’s why i want to ask you first before i add a bug to the bugtracker. Its about the the getDocumentObject Function in document.parser.class.inc.php. I searched the community and google but found nothing so if there was allready some discussion about this please let me know.

    This function should also returning the template vars for the Document which you’ve stated in $identifier parameter, but as far as i(or we) see and tested it, and it always returns the the template vars from the document which $modx->documentIdentifier returns:

    $sql .= "LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues")." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '" . $this->documentIdentifier . "' ";


    instead of:

    $sql .= "LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues")." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '" . $identifier . "' ";


    it’s on line 950 in manager/includes/document.parser.class.inc.php on modx 0.9.6.3

    thanks for advice

    jonas
      • 22303 MODX Staff
      • 10,725 Posts
      getDocumentObject is an internal function and not a public API function. It is part of the request handling process in MODx and not meant for use in components.
        • 3749
        • 24,544 Posts
          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
          • 14616
          • 3 Posts
          thanks for help we’ve just solved it with getTemplateVarOutput, but i think it’s a little bit weird i’ve there’s the possibility to get a document with templateVars but only for the document your in at the moment, even there is a $identifier which gets the documents content. So if you open the function with an documentId in $identifier which is not the document your in at the moment, you get the content of document from $identifier but the templateVars from the document which your in at the moment, am i right with this?

          thanks again for help