We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16873
    • 40 Posts
    huh
    It’s well known to everyone that It’s based on the two parameters--’documentMethod’ and ’documentIdentifier’’’ to get some docment . U can find details in the file named "document.parser.class.inc.php" . (it means that if u want to indicate some DOCment ,the 2 parameter are indispensably ) and U can see there are no changed on the two parameters after them appear.

    But in some snips and chunks, there is only one parameter-documentIdentifier. Such as Dropmenu , UserComments.

    And in the logistic, is it hidden erro !!!!!
    -----------------------------------------

    PS: the problem is find because i want to change the core code to fit the setting of Shared Server
    =================================
    [For Chinese]
    我们在document.parser.class.inc.php中可以发现,要查询某一文档的时候,必须拥有两个参数:’documentMethod’ 和 ’documentIdentifier’’’,并且这两个参数在核心代码中一直没有被改变过。
    但是我们在检验其他代码的时候,比如下拉菜单的dropmenu和评论UserComments的时候,发现他们标志判断一个文档的时候只用了一个参数:documentIdentifier,那么即使现在我们没有出任何差错,但是在逻辑上说,是否这样的设置是不行的呢?

      • 22303 MODX Staff
      • 10,725 Posts
      $modx->documentIdentifier is always changed to numeric (and method to id) by the time a snippet gets to it. This is an internal mechanism and should never be modified in the course of a request.
        • 16873
        • 40 Posts
        Quote from: OpenGeek at May 19, 2006, 09:23 AM

        $modx->documentIdentifier is always changed to numeric (and method to id) by the time a snippet gets to it. This is an internal mechanism and should never be modified in the course of a request.
        Thanks for giving directions. can U show some details about the " internal mechanism" , because i can’t find any trail of modify in the php code. Maybe miss them . Maybe by the RewriteMod of Apache Server.

        In any case, now it works well beacause i put some code before the evalSnippets($source)
        $this->documentMethod='id';
        		$this->documentIdentifier=$this->documentObject['id'];


        Thanks.
        Sorry for my poor English. wink
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          In the function cleanDocumentIdentifier the value of documentMethod is determined and set. Also in the ExecuteParser function, around lines 1006 - 10013 is some more code to check and set the value. The function getDocumentMethod also sets this value.
            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
            • 16873
            • 40 Posts
            Thanks For reply so quickly . smiley

            And we’ll check the original fuction 。 Because now , we steer clear of Functions cleanDocumentIdentifier and cleanDocumentIdentifier .