We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24531
    • 213 Posts
    i found out that ditto doesn’t parse TVs with @inherit, i searched through forum and found this topic:

    http://modxcms.com/forums/index.php?action=printpage;topic=36342.0

    there’s solution by using additional snippet GetField which works fine but seems kinda lame (why using another snippet instead of fixing the issue?) i’m also found thread:
    http://modxcms.com/forums/index.php?topic=27890.0

    where someone said that he filed a fix for this issue almost year ago but it seems that this fix has never been incorporated in ditto source code...
      • 6659
      • 18 Posts
      I got this working in Ditto and Wayfinder with a similar fix (I also spoke to Mike Schell - the "someone" you mentioned who found a fix - he tells me the fix I found is basically the same):

      Change line 782 onwards of ditto.class.inc.php from:

      $defaultOutput = getTVDisplayFormat($row['name'], $row['default_text'], $row['display'], $row['display_params'], $row['type'],$row['contentid']);
      foreach ($docIDs as $id) {
          if (!isset($resourceArray["#".$id])) {
              $resourceArray["#$id"][$tvname] = $defaultOutput;
              $resourceArray["#$id"]["tv".$tvname] = $resourceArray["#$id"][$tvname];
           }
       }


      to:

      if (strtoupper($row['default_text']) == '@INHERIT') {
          foreach ($docIDs as $id) {
              $defaultOutput = getTVDisplayFormat($row['name'], $row['default_text'], $row['display'], $row['display_params'], $row['type'], $id);
              if (!isset($resourceArray["#".$id])) {
                  $resourceArray["#$id"][$tvname] = $defaultOutput;
                  $resourceArray["#$id"]["tv".$tvname] = $resourceArray["#$id"][$tvname];
              }
          }
      } else {
          $defaultOutput = getTVDisplayFormat($row['name'], $row['default_text'], $row['display'], $row['display_params'], $row['type'],$row['contentid']);
          foreach ($docIDs as $id) {
              if (!isset($resourceArray["#".$id])) {
                  $resourceArray["#$id"][$tvname] = $defaultOutput;
                  $resourceArray["#$id"]["tv".$tvname] = $resourceArray["#$id"][$tvname];
              }
          }
      }


      And for wayfinder.inc.php, change line 459 onwards from:

      $defaultOutput = getTVDisplayFormat($row['name'], $row['default_text'], $row['display'], $row['display_params'], $row['type']);
      foreach ($docIDs as $id) {
          if (!isset($resourceArray["#{$id}"])) {
              $resourceArray["#{$id}"][$tvname] = $defaultOutput;
          }
      }


      to:

      if (strtoupper($row['default_text']) == '@INHERIT') {
          foreach ($docIDs as $id) {
              $defaultOutput = getTVDisplayFormat($row['name'], $row['default_text'], $row['display'], $row['display_params'], $row['type'], $id);
              if (!isset($resourceArray["#{$id}"])) {
                  $resourceArray["#{$id}"][$tvname] = $defaultOutput;
              }
          }
      } else {
          $defaultOutput = getTVDisplayFormat($row['name'], $row['default_text'], $row['display'], $row['display_params'], $row['type']);
          foreach ($docIDs as $id) {
              if (!isset($resourceArray["#{$id}"])) {
                  $resourceArray["#{$id}"][$tvname] = $defaultOutput;
              }
          }
      }


      I’ve tested this a little and it seems fine, but by no means have I tested extensively. Use entirely at your own risk and test thoroughly!
        • 3785
        • 143 Posts
        Thanks DaveChild you saved my day! smiley
          Medianotions – Studio für Webdesign
          http://www.medianotions.de
          • 33337
          • 3,975 Posts
          Quote from: rav3n at Jun 08, 2009, 01:15 AM

          ...

          where someone said that he filed a fix for this issue almost year ago but it seems that this fix has never been incorporated in ditto source code...


          Probably its never been filed in JIRA?

          Please file it in JIRA, and I think it will made into Evo. wink
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link