Closed (fixed)
Project:
Money field
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Dec 2008 at 22:46 UTC
Updated:
8 Dec 2008 at 01:20 UTC
The base field types that are provided with cck implement hook_diff() in includes/content.diff.inc
Comments
Comment #1
markus_petrux commentedGood point. Not sure when, but I'll try.
I plan to create a new release (and I'll try to add diff support as well) as soon as this patch in CCK is committed: #131953: Expose additional database columns to Views (not just 'value') (related issue in Money CCK queue: #335546: Expose separate fields to views, not just the amount)
Comment #2
markus_petrux commentedWould you mind trying this?
Please, open money.module and add the following to the end of the file. Then try diff comparing revisions for nodes with money fields. Works? How does it look?
Comment #3
BrightLoudNoise commentedThat appears to work, however it also throws the following warning.
warning: preg_match() expects parameter 2 to be string, array given in /var/www/drupal/drupal-6.6/includes/bootstrap.inc on line 737.Comment #4
BrightLoudNoise commentedThat particular line is from the drupal_validate_utf8 function in bootstrap.inc, if that helps at all.
Comment #5
markus_petrux commentedProblem described in #3 and #4 is caused by a bug in CCK module. Please, try the patch I attached here: #344004: Content diff integration causing problems when other fields implement diff support
Comment #6
markus_petrux commentedFeature committed to CVS. Though, it is implemented in a separate file that is loaded only if diff module is enabled. It still requires the bugfix in content module mentioned in #5
Comment #7
markus_petrux commentedComment #8
BrightLoudNoise commentedThanks Markus!
Comment #9
yched commentedCCK bug is fixed.
I also changed the way it works to a more hook-based solution - you now don't need to implement hook_diff(), but only need to provide hook_content_diff_values() (basically the previous _money_diff_values() in the code above. The current code should still work, though.
See content.diff.inc for more info.
Also, I'm having a hard time seeing how the _money_diff_values() above can work for a money field with multiple values.[edit: forget it, my bad, it rightfully works :-).]