I'm trying to configure a Kinnexus server.

It connects OK, but only if I use Basic as opposed to Digest.

Next, PIRETS only fetches the first Property Class, ignoring the others.

Then everything is fine until I need to choose a "Sales Statuses" in the Search Limits, nothing appears in the options.

This is happening with the latest BitTorrent code too.

My pirets_is_kinnexus variable is not being set, I assume because my server response header looks like this...

HTTP/1.1 200 OK
Date: Sun, 28 Nov 2010 02:21:35 GMT
Server: Apache/2.2.9 (Debian) mod_ftp/0.9.7-dev PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 mod_perl/2.0.4 Perl/v5.10.0
Cache-control: private
RETS-Version: RETS/1.5

Maybe an option in server settings where I can set my server as 'Kinnexus'?

I'm happy to help with all I can... thanks.

Comments

drupaler2000’s picture

I was able to get all classes to show by replacing function _pirets_explode_compact with the following, my changes are in the foreach loop...

function _pirets_class_explode_compact($data, $child = NULL) {
  $xml = new SimpleXMLElement($data);
  $return = array();
  $headers = array();
  if ($child !== NULL) {
    $xml = $xml->{$child};
  }
  if (isset($child->DELIMETER[0])) {
    $delim = chr(hexdec(strval($xml->DELIMITER[0]['value'])));
  }
  else {
    $delim = "\t";
  }
  // These substr() calls are trimming off the tabs at the beginning and end
  // of the rows without hacking off tabs representing blank columns as trim()
  // would.
  $headers = explode($delim, substr(strval($xml->COLUMNS[0]), 1, -1));
  foreach ($xml as $row) {
    $vals = explode($delim, substr($row->DATA, 1, -1));
    // Note that some idiot RETS providers may be serving fields with names
    // which are entirely numeric; for example, the list price will be in field
    // "173." Care must be taken that we don't prompt PHP to reindex arrays with
    // field data, because the indexes will change on fields with these numeric
    // field names, causing trouble down the line. For example, the line below
    // used to use array_merge() to combine the array with the crc32 value, but
    // this was prompting reindexing. Now we're using the + operator, which
    // achieves the desired result without reindexing.
    $return[] = array('crc32' => crc32($row->DATA)) + array_combine($headers, $vals);
  }
  return $return;
}

of course, I had to update function pirets_query_metadata_class to call my new function...

jerry’s picture

This change also resolved the following error, which had prevented me from saving field selections from a Rapattoni 1.7.2 server:

array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /home/mule/htdocs/sites/all/modules/pirets/pirets.connect.inc on line 374.

Thanks!

jerry’s picture

Spoke a bit too soon. While that change did permit me to save field selections, it generated the same error when attempting to update a class. Reverting to the original logic allowed the update to complete normally.