Hey there I use diff module to work on a wiki-like site.

When I add some infos to a cck field, then I go to see diff with the new revision, I see that the changes are there on the revision, but diff says that there are no visible changes??

Is diff working with cck fields??

Thanks,
Patchak

Comments

moshe weitzman’s picture

Status: Active » Postponed (maintainer needs more info)

yes it does. anyone else seeing this?

will_in_wi’s picture

Title: Does diff works with cck fields? » Add ability to diff CCK Fields
Version: 5.x-2.0 » 5.x-2.x-dev
Category: bug » feature
Status: Postponed (maintainer needs more info) » Active

It appears that diff cannot do this atm, so I am changing this to a feature request.

moshe weitzman’s picture

Status: Active » Fixed

diff does this alreaady. in D6, the code is in cck itself.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Anonymous’s picture

Status: Closed (fixed) » Active

It definitely diffs taxonomy terms correctly. But with actual CCK fields, I'm seeing the same as patchak - no visible changes. Going into each revision shows the field values are definitely different.

Is anyone else seeing this? Interested if this is just a configuration problem on patchak and my parts.

Taras Zavaliy’s picture

In D6 version the problem is only with CCK Content Taxonomy fields. These fields are not shown in diff's, and correspondig terms are not tracked correctly. Only the last versions of terms are shown.
Don't know if it is hard to repair. I suppose we need to write an additional .inc file for the Content Taxonomy...

After some testing: It diff's ordinary CCK fields, but not Content taxonomy fields. And Date fields aren't showed at all.

jmroth’s picture

Version: 5.x-2.x-dev » 6.x-2.x-dev

Diffing CCK date fields actually works, but only for the start date. A changed end date is not shown in the diff. Workaround: create 2 separate fields for start and end. :-\

ronino’s picture

jmroth, I created a hook_diff() in my module to also show end date changes in the diff output. Maybe something like this should go into the date module?

/**
 * Implementation of hook_diff().
 *
 * Add the end dates of CCK fields of the 'datetime' type to the output of
 * the diff module's diff between two revisions. Inspired by content_diff() in
 * content.diff.inc from the CCK module.
 */
function my_module_diff(&$old_node, &$new_node) {
  $result = array();
  // Prevent against invalid 'nodes' built by broken 3rd party code.
  if (isset($new_node->type)) {
    $type = content_types($new_node->type);
    $field_types = _content_field_types();
    foreach ($type['fields'] as $field) {
      // Ignore fields the current user is not allowed to view.
      if (!content_access('view', $field, NULL, $new_node)) {
        continue;
      }

      if ($field['type'] == 'datetime') {
        $result[$field['field_name']] = array(
          // only specifiy the old and new values as other fields like #name,
          // #weight or #format would be merged into arrays with the equally
          // named fields specified by other hook_diff()'s which would then
          // lead to output errors
          '#old' => $old_node->{$field['field_name']}[0]['value2'],
          '#new' => $new_node->{$field['field_name']}[0]['value2'],
        );
      }
    }
  }

  return $result;
}
realityloop’s picture

higherform’s picture

With php5.3.0 + PF6.17 + Diff 6.x-2.x-dev (2010-Jul-11) + CCK 6.x-3.x-dev, the following patch fixed diff display of CCK fields:

http://drupal.org/node/714762

yhahn’s picture

Status: Active » Fixed

This patch was committed in the referenced issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.