Not sure if it's possible without throwing a validation error, but it'd be great if we could highlight the affected fields when reporting about modifications or conflicts.
I wonder if we could even just mark conflicting fields with form_set_error() but still allow the user to resubmit with the "invalid" value to overwrite?
| Comment | File | Size | Author |
|---|---|---|---|
| #39 | 1599490.diff | 15.9 KB | drumm |
| #22 | 1599490.diff | 15.67 KB | drumm |
| #20 | conflict-highlight-fields-during-conflict-resolution-1599490-20.patch | 16.17 KB | m1r1k |
| #20 | interdiff.txt | 14.5 KB | m1r1k |
| #16 | interdiff-1599490-15-16.txt | 1.75 KB | elijah lynn |
Comments
Comment #1
bdragon commentedThe problem with form_set_error() is the form doesn't get rebuilt if there are errors. I think doing some of the stuff that #ajax does regarding messing with the cached form might work as a workaround though.
Comment #2
mitchell commented> highlight the affected fields when reporting about modifications or conflicts.
What about saving another revision and redirecting to a Diff view? Also, Revisioning is able to support nodes (not entities) in multiple states.
There was also this early stage Conflict Resolver module that might help a tiny bit.
Comment #3
cweagansPer https://association.drupal.org/node/18268, a dev is needed here. I'll run with this.
Comment #4
drummConflict Resolver is D6 only, it likely won't help.
I don't really want to install Revisioning just for this.
Saving another revision and using Diff sounds complicated.
I think we should keep this simple and within Conflict module. If there is a way to use the existing Form API error styles during build, that should be okay.
Comment #5
cweagansSo another project landed on my plate and I'm not going to be able to get to this for a while. If somebody else wants to pick it up and run with it, go for it. Otherwise, I'll circle back and take a look in a week or two.
Comment #6
drummMoving out of the launch priorities since this feature can be deployed whenever it is committed to conflict module.
Comment #7
drumm(tag)
Comment #8
m1r1k commentedHere is patch, pure form_set_error() does the jobs.
Comment #9
tvn commentedComment #10
drummThis completely prevents the form from being saved. The "Save again to overwrite it." part of the error message should work as it says. See also comment #1.
Can we set the error class or otherwise mark it in the
$formarray?Comment #11
m1r1k commentedYes, my bad. Here is patch with pure highlighting through 'error' class
Comment #12
m1r1k commentedComment #13
drummDo we really want to always set both? Actually, this might want to iterate over all the children, for multiple-item fields.
Comment #14
bdragon commentedThinking out loud:
Comment #15
m1r1k commentedComment #16
elijah lynnAppears to work so far!
Added some doc corrections and marked RTBC because they are so minor.
Comment #17
sunLet's add unit and/or integration tests here.
This module continues to cause lots of pain for d.o. Root cause is a total lack of tests.
Comment #18
tvn commentedm1r1k, please, re-assign to yourself if you are planning to work on this.
Comment #19
m1r1k commentedComment #20
m1r1k commentedHere is fixed version with tests.
Comment #21
drummWhy was this change made?
Comment #22
drummAttached is an untested re-roll.
Comment #23
drumm(This will likely need another re-roll, #2210937: Conflict module over-reporting conflicts during crosspost, preventing issue updates incorrectly covers some of the same changes in a different way, that looks more thorough.)
Comment #24
drummAnother untested re-roll.
Comment #26
drummImproved re-roll, I missed some now-redundant code.
Comment #27
drummComment #34
drummIt looks like the messages are correct with manual testing. They may be swapped around in the test.
This patch replaces
in
testComplexTroublesCase(), to be sure it isn't a cache problem.Comment #35
drummComment #37
drummThis corrects the Title field label in
_conflict_get_node_changes(). "Node" should not appear in UI text, and the tests test for that.Comment #39
drummI think the new diff algorithm was detecting the difference between
NULLand an empty string in the Body's summary. The UI will never generate aNULLsummary, so this sets it to an empty string indrupalCreateNode().Comment #41
drummThat's better. Thanks for the thorough tests!
Comment #42
drummComment #43
drummNow deployed on Drupal.org.