If you happen to place more than one tablemanager table in a node:

The first table:

[tablemanager:4,,,column=1|start="Fred"]

another table

[tablemanager:6]

Then in this case tablemanager will apply the filter from the first table to the second table as well.

Geoffrey

Comments

pobster’s picture

Very disheartening that this hasn't been picked up on previously. Its simply down to an incorrect placement of the commands in tablemanager_process which reset the variables which store the attrib info. I'll post a patch later.

Pobster

pobster’s picture

Crap I forgot all about this... Sorry...

Anyways, just change the function _tablemanager_process_text to this (and let me know if it solves the problem);

/**
 * Function to match and process the tablemanager filter
 */
function _tablemanager_process_text($text) {
  $pattern = "/\[tablemanager:(\d+,?\w*,?\w*,?\w*=?\d*\|?\w*=?\w*\|?\w*=?\w*,?.*?)\]/i";
  if (preg_match_all($pattern, $text, $matches)) {
    foreach ($matches[1] as $no => $args) {
      $date = array(); // these two variable declarations
      $attrib = array(); // have moved - and NOTHING else is changed.
      $arg = explode(',', $args);
      if ($arg[3]) {
        $params = explode('|', $arg[3]);
        foreach ($params as $param) {
          $temp = explode('=', $param);
          $date[trim($temp[0])] = trim(trim($temp[1]), '"');
        }
      }
      if ($arg[4]) {
        $params = explode('|', $arg[4]);
        foreach ($params as $param) {
          $temp = explode('=', $param);
          $attrib[trim($temp[0])] = trim($temp[1]);
        }
      }
      $text = str_replace($matches[0][$no], tablemanager_display(trim($arg[0]), trim($arg[1]), trim($arg[2]), $date, $attrib), $text);
    }
  }
  return $text;
} // _tablemanager_process_text

Thanks,

Pobster

summit’s picture

Subscribing, greetings, Martijn

pobster’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing as D5.x is now unsupported.