We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6726
    • 7,075 Posts
    I don’t know where this comes from, but when I try to update from 1.1 to 1.2 I have an error message :

    Precondition Failed
    The precondition on the request for the URL /fuchslock/manager/index.php evaluated to false.


    It never happened and it does not happen with other snippets. I didn’t modify anything or add a space at the end or whatever.

    Anyone ?
      .: COO - Commerce Guys - Community Driven Innovation :.


      MODx est l'outil id
      • 18397
      • 3,250 Posts
      Odd. Never had that happen..........

      No idea what could be causing that.
        • 18397
        • 3,250 Posts
        New Version 2.0!

        * 25-Nov-2005 added multisort capabilities (Jason/Mark)
        * 25-Nov-2005 added ability to call useful parts of the document object in a template via [+documentobject+] (Mark)
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Interesting. I’ve modded my version to allow the sort field to be specified in an argument; I check it against the column names in the table and go to default if an invalid value was used. It uses the original query with no problems. So you can specify any column in the site_content table to sort by. I also added the option to specify asc or desc.

          $results = $modx->db->query("show columns from ".$modx->getFullTableName('site_content'));
          while($dbfield = $modx->db->getRow($results))
             $dbfields[] = $dbfield['Field'];
          if(isset($sortby) AND in_array($sortby,$dbfields)) {
             $sortby = $sortby;
          } else {
             $sortby = "createdon";
          }
              // check for valid field to sort by
          
          $sortdir = isset($sortdir) ? strtoupper($sortdir) : "DESC";
              // get sort dir
          
          $output = '';
              // initialize the blog variable 
          
          $callby = ($showPublishedOnly)? 'getActiveChildren' : 'getAllChildren';
          
          $resource = $modx->$callby($resourceparent, $sortby, $sortdir, $fields='id, pagetitle, longtitle, description, introtext, content, createdon, createdby, hidemenu');
            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
            • 6726
            • 7,075 Posts
            I still have this error when trying save the 2.0 version... I did some looking into the error message and I found :

            412 Precondition Failed : The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server.

            I am hosted @TextDrive and never had a problem like this before... I updated the snippet via phpMyAdmin in the meantime...

            (For reference I run MODx 0.9.0)

            Quote from: Mark at Nov 25, 2005, 02:21 PM

            Odd. Never had that happen..........

            No idea what could be causing that.
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 18397
              • 3,250 Posts
              Is your error for just this snippet or any snippet?

              If its just this snippet try breaking it up into little pieces until it won’t save. Let me know which piece fails and we’ll take it from there.
                • 6726
                • 7,075 Posts
                No, every other snippet is OK, just this one. I already had this error when trying to update to 1.2, in fact...

                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l'outil id
                  • 32241
                  • 1,495 Posts
                  Does it support tv in the new v2.0 of newslisting snippet?

                  When it said document object, does it mean the default from MODx or including TV.

                  If it’s not supported yet, will there be any possibility where it will be implemented later?

                  Thanks

                  Regards,
                  Wendy Novianto
                    Wendy Novianto
                    [font=Verdana]PT DJAMOER Technology Media
                    [font=Verdana]Xituz Media
                    • 18397
                    • 3,250 Posts
                    TV’s are not supported yet in NewsListing, but they *hopefully* will be soon.
                      • 32241
                      • 1,495 Posts
                      Quote from: Mark at Nov 28, 2005, 11:41 PM

                      TV’s are not supported yet in NewsListing, but they *hopefully* will be soon.

                      How soon will it be implemented? I’m really2 looking forward to it... smiley

                      Thanks guys....

                        Wendy Novianto
                        [font=Verdana]PT DJAMOER Technology Media
                        [font=Verdana]Xituz Media