Closed (fixed)
Project:
Diff
Version:
7.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Apr 2008 at 00:30 UTC
Updated:
22 Oct 2012 at 21:11 UTC
Jump to comment: Most recent file
Would it be possible for the Diff module to show the changes to taxonomy terms made in the node? The diff would show the removed terms and/or the new terms added.
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | diff-compare-term.png | 2.89 KB | alan d. |
| #27 | diff-compare-term-with-id.png | 4.11 KB | alan d. |
| #15 | add-taxonomy-support-248778-15.patch | 4.07 KB | duaelfr |
| #15 | add-taxonomy-support-248778-15-incremental.patch | 2.03 KB | duaelfr |
| #14 | add-taxonomy-support-248778-13.patch | 3.91 KB | duaelfr |
Comments
Comment #1
moshe weitzman commentedThe D6 version of diff does this. If you aren't seeing this, it is a bug.
Comment #2
Encarte commentedSorry, I'm still working with 5.x (no views and no cck in 6.x yet...). I changed the version and marked it with «minor» but, since it's already in 6.x maybe there are more important things to do and maybe this feature request should be postponed or marked with fixed...
Before I open another feature request, is there a page where I can find the list of new features in 6.x? Does it show the publish/unpublish/sticky/unsticky changes? What about changes made by other modules like Workflow and Workflow-ng or Links package? I think the Diff module is getting almost as perfect as the diff tool in wikipedia. Or are we there already and I just don't know it yet?
Comment #3
moshe weitzman commentedthere is no list of changes beyond reading the CVS commits whcih you can do at cvs.drupal.org.
core does not track taxonomy changes in 5 so there is no data for diff to work with. in general, cck fields are properly segregated and shown when differences occur. this is now in the cck download for D6. it is in the diff download for d5.
we do not currently show changues in sticky/poublished but could do that. if workflow-ng wants to implement hook_diff(), it can. make a request in that queue.
Comment #4
Encarte commentedThank you very much. I'll look into this possible feature requests once I start testing D6.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
rdeboerTaxonomy term comparison is not happening in D7. It is in D6.
Comment #7
katbailey commentedI've written a patch that supports taxonomy term reference and node reference field diffs. The thing is that it doesn't really make sense without #1224996: node_diff() only diffs modified existing values, ignores newly added or removed ones (otherwise, it'll only show a diff if you remove one term and add another from that vocab at the same time). So I'm attaching two versions of the patch - one being against the 7.x-2.x branch, and one against a local branch with the patch from the afore-mentioned issue applied. I'm sure there's a better way to handle dependent patches, I'm just not sure what it is :-/
Also, the solution isn't ideal, in that it explicitly supports the above-mentioned field types. It should be more generic. I'm wondering if drunken monkey's plans for this module include a dependency on Entity API?
Comment #8
katbailey commentedForgot to change the status...
Comment #9
katbailey commentedSo... the patch in #1224996: node_diff() only diffs modified existing values, ignores newly added or removed ones got in (w00t), but I needed to write a follow-up patch because it wasn't working with the Preview changes functionality. So now I've rolled a version of the taxonomy/noderef support patch that will apply to the latest 2.x code patched with that follow-up patch...
Comment #10
mrharolda commentedSubscribing...
Comment #11
tecjam commentedYes, this would be wonderful!
I've give this some tries over the weekend.
Comment #12
Encarte commentedThis was a feature request (a backport request actually) for D5 in 2008 and, like moshe weitzman said in #1, it would be a bug in D6. It's unimaginable that a D7 version of Diff doesn't deal with taxonomy. I think this should be considered a bug and a major one.
Comment #13
duaelfrHi !
I needed this for one of my clients so I did it.
It may be perfectable but it works well.
It has been initially designed to work with tags so when you just change the value of a classical taxonomy field, you will see it like a term was removed and another added.
The patch apply well on the last dev version (7.x-2.0+10-dev)
Enjoy
Comment #14
duaelfrHi,
There is a little upgrade for my previous patch.
Two files :
- add-taxonomy-support-248778-13.patch if you patch directly from the dev branch
- add-taxonomy-support-248778-13-incremental.patch if you patch from my previous post
Enjoy
Comment #15
duaelfrThere another little patch fixing an issue showing warnings when the taxonomy field have a cardinality of 1 and is empty.
Files applies as seen in #14.
Comment #16
Taxoman commentedTime to push this to -dev?
Somewhat related: #1365750: Generalize API and Integrate with core field types
Comment #17
duaelfrI don't know if the official maintainers are still keeping an eye on this project.
Comment #18
alan d. commentedI personally would prefer diff to parse and decide what available fields are present to prevent every module that implements hook_diff() from having to do this themselves. Using the code from the other thread, this would reduce the amount of code required here to only 8 or 10 loc
Comment #19
Encarte commented@DuaelFr I think realityloop sure could use some help from new maintainers. For instance, this issue needs review since February and it's a major regression (from D6) on a major module with more than 30000 users.
Comment #20
duaelfr@Alan : you are right but my purpose here was to propose a quick fix to this old issue.
@Encarte : it is a functional regression but regarding to the huge changes made to the core between D6 and D7 we cannot blame anybody.
I would like to have more time to help but I am already responsible of another module which may feel abandoned ;)
Comment #21
Encarte commentedBut I don't blame anybody. On the contrary, I only have good things to say about people who brought this module to where we have it now, especially realityloop who seems to be all alone at the moment. I just wish we could multiply them.
Comment #22
duaelfrI would love to be paid for helping Drupal grow, but I am not, so I try to help as I can. Thank you for the link, I missed it and it looks really interesting.
Comment #23
alan d. commentedI didn't roll a patch in the other thread, but from basic testing, the functionality was sound. If that, or similar approach, gets in, this issue could be reduced to:
That is, if visually scanning the delta values is enough, cf. with a full report. :)
Comment #24
alan d. commentedOK, trying to push forward with full coverage of all core fields. I've refactored the other approach slightly, but this will add minimal functionality by itself.
Many fields will get free diff support as I am checking both the safe_value and value fields rather than just the value column.
I would love it if someone can review the patch here.
http://drupal.org/node/1365750#comment-6108002
I've spent the last 30min setting up core fields: list, number, text, image, file, taxonomy terms but it will be tomorrow before I get a chance of working on the implementation of these.
Comment #25
dwwNot sure how hook_diff() works, but the code in #23 appears to introduce XSS vulnerabilities via
$term->name. However, if diff.module itself is sanitizing everything returned by hook_diff() before display, we're fine. Someone should double-check before this gets RTBC or committed.Comment #26
alan d. commentedMassive patch over in #1365750: Generalize API and Integrate with core field types needs some testers. If accepted, this will make this issue a duplicate.
@dww
These were getting escaped, but I didn't check. Without directly tracing to these functions, I guess this is where that is done:
That callback in #23 sets the #old and #new parameters. And cf. current implementation, this would be an issue that would have come up really quickly!
Comment #27
alan d. commentedIn another task, I'm refactoring the field comparison.
These are two raw outputs based on selecting to display the term id or not. Currently the output is controlled by a system variable that defines the defaults.
The change in the ID to the more verbose form was to ensure that all displays were similar for the core fields. See #1458814: File (and image) field support for screenshots for file and image comparisons to see this.
The default is to hide the term id as this is what happens in Drupal 6.x
Comment #28
alan d. commentedThis should be resolved with the new branch, 7.x-3.0-alpha1 or 7.x-3.0-dev.
This is still alpha, so test carefully before use on a production site and report any issues back to the queues.
Comment #29
Taxoman commentedIf there is going to be a 7.x-2.1 release, should not this fix be adapted to that branch as well as to 3.x?
Comment #31
dwwAgreed, this should probably be fixed in 7.x-2.x as well.
Thanks,
-Derek
Comment #32
alan d. commentedI was probably being very overly cautious just making the first release of the 3.x branch an alpha. There are a few dozen users of 3.x already and no reported issues. Fixes Option list, core Term fields, File & Image fields.
In contrib already:
Commit 2025356 on Countries 7.x-2.x has added support.
Commit 7b3e640 on Name Field 7.x-1.x
Patches for Diff Field support in the queues include:
#1685698: Provide field support for diff (email field)
#1350604: Diff support for Date fields
#1595702: Diff support of field collection fields
#1686024: Diff (7.x-3.x) support for Link fields
And there were about 10 or 15 other features / bugs resolved in the process.
So afaict, you are losing out by sticking with 2.x even if the core fields are fixed. So please test if 3.x if fully functional on your site and report back with any issues. Backporting will only slow the release of 3.0
If these go into the 2.x branch, all core fields should be considered together as the repetitive instance looping is causing performance issues. Maybe just terms and option lists fields.
Moving forward with 3.x, within the next couple of weeks, the field display level diff settings will be removed (only currently visible via additional module) and the content type settings moved to a singular location, and that will be released a either rc1 or beta1. No additional functionality is planned, other than unifying these settings. Note that with the release of alpha version, marks the end of rapid prototyping of the 3.x branch and additional functionality will go though the issue queues in a more sedate manor, preferably introducing automated testing for existing and new functionality.
Comment #33
mitchell commentedThis is fixed in 7.x-3.x. Backport requests should be made in separate issues, if absolutely necessary.