Hi guys,
I don't think anyone else has specifically asked for anything like this, but it would be great to have a drupal_alter for $node_diffs so that it's possible for to remove any unwanted fields?
Use case is WYSIYWG ImageField, as the ImageField is irrelevant (and mostly hidden) a comparison is wasteful.
No patch as it's a one line change:
Add the following line after the module_invoke call on line #340 of diff.module:
drupal_alter('node_diffs', $node_diffs, $old_node, $new_node);
Cheers,
Deciphered.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | diff-888680-2-Allow-modules-to-interact-via-drupal_alter.d6.patch | 617 bytes | alan d. |
| #3 | diff-888680-2-Allow-modules-to-interact-via-drupal_alter.d7.patch | 2.5 KB | alan d. |
Comments
Comment #1
realityloop commentedKeen to add this, but there is no line #340 in current dev
Comment #2
alan d. commented@realityloop
I'm going to push through a number of minor patches that should go in before the big patch. This will make it easier to backport these to Drupal 6 and provide better tracking.
Looking forward, the Drupal 7 patch introduces the diff.api.php file that hints at the upcoming changes and warns users that hook_diff() is depreciated. The actual alter is:
And Drupal 6 is just:
Comment #3
alan d. commentedI wish I had a dollar for every time that I save before attaching the patches :)
Comment #4
alan d. commentedTo give commit credit (and thus someone to blame if things go wrong) the following format can be used:
D7
git commit --author="aland <aland@198838.no-reply.drupal.org>" -m="Issue 888680 by Deciphered, Alan D.: Allow modules to interact via drupal_alter()"
D6
git commit --author="deciphered <deciphered@103796.no-reply.drupal.org>" -m="Issue 888680 by Deciphered, Alan D.: Allow modules to interact via drupal_alter()"
Usage
Apply patch
git add -A
The commit
(repeat for other patches on branch)
Push
The author gets the commit authorship once pushed but I'm not sure what the other user roles get. My policy is to push through individual commits accrediting the code writer, and note users that have interacted in a significant way in the commit - aka users that reported the bug, testers, reviewers, etc. Though sometimes I do use "John Doe, et al:" if there are many.
No-one seems to use format-patch :(
Anyway, it is a nice way of tracking users through the system and I think that if more maintainers use this, it should spark more interest in non-maintainers to actually write patches
Comment #5
decipheredAlan, I was specifically told not to use it by core developers, which is disappointing as I recall them making a a huge deal about people getting the appropriate attributions for their patches, but none of my core patches where attributed to me :|
Ah well, it's not about the individual, it's about the project.
Patches look good, I'll give them a quick test this afternoon, but I don't see any reason they can't be RTBC.
Comment #6
alan d. commentedCore is different, it never happens.
http://drupal.org/node/38878/committers is a great example why to
Comment #7
decipheredI'm all for it, and I work with Realityloop so I can assure you he will be too.
Comment #8
alan d. commentedCool, I may have to get you to get your project manager to free some time contrib time for Brain to push some things through :)
Comment #9
tim.plunkettFixing tags
Comment #10
alan d. commentedThis should be resolved with the new branch, 7.x-3.0-alpha1 or 7.x-3.0-dev.
Comment #11
alan d. commentedActually, this can be backported if I find the time :)
Comment #12
mitchell commentedThis is fixed in 7.x-3.x. Backport requests should be made in separate issues, if absolutely necessary.