We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14006
    • 2 Posts
    Hello,
    I use the NewsManager to create/edit and delete news messages with the front page login.
    This works correct but when i set paginate=`1` i get an error on on SQL: UPDATE `db0002a`.`modx_site_content` SET createdon=’1244618676’ WHERE id =


    I can not find the code in this snippet and i don’t know where the error came from.

    the call i make is like this

    [!NewsManager? &folder=`7` &editformid=`9` &headertpl=`news.AdminHeader` &footertpl=`news.AdminFooter` &rowtpl=`news.AdminRow` &alwaysshow=`1` &paginate=`1`!]

    When i don’t use the templates/chunks the error is till the same...
    What can i do?

    Thx
      • 18913
      • 654 Posts
      I’m getting a similar error (different database, createdon number), running under MODx 1.0.0/Evolution.

      Did you ever get a solution?
      Matt
        • 1555
        • 1 Posts
        In case anybody runs into the same problem with NewsManager and pagination, I found a solution to this on the Russian side of the forum: http://modxcms.com/forums/index.php?topic=14884.0

        A rough Google translation of the thread gave me the solution. In the NewsManager snippet, look for the // For all articles section and add $stop = min ($stop, $nrtotal);

        This section now looks like:
        // For all articles
        for ($x = $start; $x < $stop; $x++, $rownum++) {
          if ($resource[$x]['createdby'] < 0) {
            // get web user name
            $tbl = $modx->getFullTableName("web_users");
          }
          else {
            // get manager user name
            $tbl = $modx->getFullTableName("manager_users");
          }
          $link = '';
          $stop = min ($stop, $nrtotal);
        
          • 4855
          • 28 Posts
          I get that error when my content is less than &nrpost (number of post to be displayed, default is 10)
            • 22687
            • 19 Posts
            ceplo.
            I got that error too - when trying to break the returned newsmanager iterations into a paginated form - using the newsmanager paginate parameter - there seemed to be no way to reach the final page - but the fix to the newsmanager snippet above sorted it out.

            the newsmanager call is this
            [!NewsManager? &folder=`48` &editformid=`49` &nrposts=`5` &paginate=`1` &template=`Global_main` &rowtpl=`NewsManager2tmpl` &clearcache=`1`!]


            and the pagination placeholders that add the navigation to the page are like this - for me anyway.
            Showing entries [+start+] to [+stop+] ~ of a total of [+total+] entries.
            
            [+previous+][+pages+][+next+]