Closed (fixed)
Project:
Driven API
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Aug 2010 at 15:21 UTC
Updated:
21 Feb 2011 at 22:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
arhak commentedthis patch contains both: support for filefield_sources and #865388: Filefield reporting all files removed and added
(so you only have to apply this one to 6.x-dev to get them both)
PS: this issue started from #865388-12: Filefield reporting all files removed and added
this is a quick patch that should work, but I haven't reviewed filefield_sources yet
Comment #2
arhak commentedtypo
Comment #3
jthomasbailey commentedSeems to work, thanks a lot
Comment #4
bibo commentedI had the same problem with filefield_sources. Hopefully this fix will be in the next dev-release :)
Comment #5
bibo commentedSetting to RTBC.
Comment #6
vito_a commentedNeeded to fix it some more to show filefield diffs properly though, hope some simple illustrations will help to understand why that was needed:
(Attachments is a filefield which was used to replace comment_upload functionality due to the http://drupal.org/node/739690 and yes, the steps given at the http://drupal.org/node/739690#comment-2803752 are working, though found no time to write a handbook page or FAQ on that issue also, hope someone can do that)
The issue for me was content_field() doesn't always return $old_view and $new_view properly if $node is given to it like
and it performs better if there is a node:
Patch attached was done against the latest 1.x-dev version and includes the http://drupal.org/files/issues/2010-08-03_872726_support_filefield_sourc... from #1 so can be applied alone. Big thanks to arhak . Proposed way of loading the full nodes seems to be far from ideal, hope we can discuss that and find a better solution, though it's working for some particular cases, as shown by the second picture.
Comment #7
arhak commentedhow would "improperly" precisely looks like?
I guess it is a matter of figuring out what is actually missing for the dummy $node to work properly
(relying on args is unacceptable, it only solves the vanilla case, consider panels for instance)
by "some" you mean "not every"?
do you know a case which still fails? even with your proposed patch
what made you think it wouldn't be an array?
did you hit that line with that index undefined? or any other kind of data?
Comment #8
vito_a commentedThank you for paying much attention to these issues, as some of these seem to be very annoying sometimes, and it's very good to see someone who cares :)
Though it seems that some more investigation of the case is needed.
As for "improperly", it just looks like driven_filefield_notpatched.png for me, $old_view and $new_view are both returned Array() (empty arrays).
Yes, exactly what I was talking about, that seems to be solving that node "view" vanilla case, and there may be much other cases, that is only one $op. Also I'm considering it just a quick solution. However don't we need these diffs shown at the "view" case first of all?
Yes, it will be very good to figure out what is actually missing for the dummy $node to work properly. I hope someone will have some time to find it. Can someone help us with this case please as some time seems to be needed to check it thoroughly?
Unfortunately I can't provide the full case study at the moment thus can't say exactly in which cases diffs would fail and would these fail at all. As for what made me think there wouldn't be arrays in the latter case, the above warnings did:
Hope that helps :)
Comment #9
arhak commented@#8 thanks
so the right direction would be knowing better the internals of content_field() for filefields, to provide whatever the dummy $node is missing
Comment #10
arhak commentedcommitted by obrienmd (see #865388-22: Filefield reporting all files removed and added )
Comment #11
arhak commented@vito_a
still pending your cases
could you please file a new issue?