Closed (fixed)
Project:
Context
Version:
7.x-3.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Oct 2009 at 21:23 UTC
Updated:
14 Jul 2012 at 15:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alex_b commentedThis approach adds an addtional validation callback that sets the context for the validation step.
There may be some other forms that suffer from the same problem. I haven't done research into that.
Comment #2
darrenmothersele commentedThis is also an issue on v3. Patch needs to be altered slightly to make this work, attached.
Comment #3
wik commentedsubscribing
Comment #4
blakehall commentedJust an FYI (and so I can keep tabs on this patch), the patch in #1 works for me with Context-2.x
Comment #5
NaX commentedpatch on #1 worked for me using Context 6.x-2.0.
Comment #6
yhahn commentedComment #7
rsvelko commentedpatch tested and works on context 3.0 also
version = "6.x-3.0"
Comment #8
adr_p commentedThis is a patch I've applied for the 3.0 version.
Comment #9
steven jones commentedNormally I'd do such a condition in an #after_build, so I might look into doing it that way instead.
Comment #10
steven jones commentedFixed in 6.x. Thanks!
Comment #11
febbraro commentedI can't reproduce this in D7 so since the form processing got a bit of an overhaul I'm inclined to think (and my debugging tells me) that context_form_alter is getting called in D7 even on a validation error (which apparently was not the case in D6 #671574: Document that hook_form_alter not called after a form fails validation).
Reopen if someone can reproduce in D7, thanks for the D6 patches.
Comment #13
rich.3po commentedI'm experiencing this issue on Context 6.x.3.0 so moving to this release and re-opening.
I've tried updating to the dev release, and whereas the node form in question is now active, a multitude of other contexts are also activated which definitely should not be (and are not on the initial node form before validation errors are triggered)
For example, i have context that should only be active for a different node type, and that is being errornously triggered on my form
Comment #14
kevinquillen commentedThe patch in #8 appears to work for me. I am not using the dev version.
Comment #15
mas5d2 commentedRunning the latest dev version, I can confirm that context_form_alter() is not being called after validation fails. Continuing debugging....
Comment #16
enzipher commentedI ran into the same issue. This patch should work against latest dev.
Cheers,
Comment #17
nlisgo commentedFor those struggling to recreate this issue. It only seems to break on validation of existing nodes. So edit an existing node, delete an field entry that is required and submit.
I favour the after_build approach as suggested in comment #9 by Steven Jones.
Here is my patch for the latest dev.
Comment #18
milesw commentedSlightly changed #17 to fix a PHP notice due to a missing argument in the after_build function. Also left the addition of the submit handler in its original place.
Comment #19
tekante commentedConfirmed that context was not applying to the node form on a validation error, patch from #18 applied after confirming it corrected the issue and based on other commentary. Thanks for the patch, should be included in the next dev build.
http://drupalcode.org/project/context.git/commit/e3326883f0adaa2340e0522...