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

    I having this error log on my manager:
    [2012-12-04 01:24:33] (ERROR @ /index.php) `[[+id]]` is not a valid integer and may not be passed to makeUrl()

    I am using &postid=`[[~[[+id]]]]` because i want every page that created /edited after the submission will display it's current page.

    Here is my code:
    					[[!NewsPublisher?
    					        &show=`StudentNo,StudentName,Address,Parent,ContactNo,Grade_Select`
                                                    &initdatepicker=`1`
    					        &parentid=`5`
    						&hidemenu=`1`
    					        &published=`1`
    					        &template=`4`
    						&postid=`[[~[[+id]]]]`								
    					        &required=`StudentNo,StudentName,Address,ContactNo,Grade_Select`
    					]]
    


    I don't know if this [[~[[+id]]]] does not allow on the NewsPublisher that's why i am having this error log?

    Need your help,

    Thank you in advance
      • 3749
      • 24,544 Posts
      +id is a placeholder and nothing is setting its value (unless you are in a separate snippet). Even if it worked, you would be sending a URL as the &postId property and it's supposed to be a Resource ID (integer), not a URL. I don't think there is a reliable way to have a dynamic &postId property setting.

      The default behavior of NewsPublisher is to forward the user to the page just edited or created, which sounds like what you want.

      You could use the following, but it will always send the user to the NewsPublisher page.


      &postid=`[[*id]]`
        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
        • 36704
        • 131 Posts
        Hi BobRay,

        I did try this
        &postid=`[[*id]]`
        and it returns me into a blank form after editing the existing resource content.

        Thanks
          • 3749
          • 24,544 Posts
          Yes, as I said, that's the expected behavior. It's forwarding the user to the NewsPublisher form, which is blank because no Resource is selected to edit.

          If you leave out the &postID property, it will forward the user to the page just edited or created.
            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
            • 36704
            • 131 Posts
            Yes you are right BobRay, and i try to remove the &postID property and it's really work now.
            Thank you... thank you... very much for helping us here in community. God will bless you more!