<div dir="ltr">Tried this. So my function signature is:<div>function si_core_node_validate($node, &$form, &$form_state) {<br></div><div><br></div><div>and the last thing I do is:</div><div><br></div><div><div> $form['refs'][LANGUAGE_NONE][0]['#options'] = $options;</div><div> $form_state['rebuild'] = TRUE;</div><div> form_set_error('refs', 'Select the potential entity links to be processed.');</div></div><div><br></div><div>yet the form displays the original field option.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 11, 2015 at 11:58 AM, Metzler, David <span dir="ltr"><<a href="mailto:metzlerd@evergreen.edu" target="_blank">metzlerd@evergreen.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Actually you should be able to alter the form in the validation function yes? Just change the function signature to pass $form by reference and make the changes
to the form that you need rather than going through the later hook? <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><br>
Dave<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:support-bounces@drupal.org" target="_blank">support-bounces@drupal.org</a> [mailto:<a href="mailto:support-bounces@drupal.org" target="_blank">support-bounces@drupal.org</a>]
<b>On Behalf Of </b>Jeff Greenberg<br>
<b>Sent:</b> Wednesday, February 11, 2015 8:45 AM<br>
<b>To:</b> <a href="mailto:support@drupal.org" target="_blank">support@drupal.org</a><br>
<b>Subject:</b> Re: [support] Changing checkboxes options during hook_node_validate<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Ok, I've tried that. The last thing I do in hook_node_validate is $form_state['rebuild'] = true; What I notice is that hook_form_node_form_alter does not fire between then and the form being redisplayed, so my pulling the options from $form_state['storage']
never happens.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Wed, Feb 11, 2015 at 10:57 AM, Jamie Holly <<a href="mailto:hovercrafter@earthlink.net" target="_blank">hovercrafter@earthlink.net</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">The checkboxes have to be added in the form creation stage, so in either hook_form or hook_form_alter. Then in the hook_validate, set a variable on $form_state['storage'] and set $form_state['rebuild'] = TRUE; and check in your hook_form
or hook_form_alter for your $form_state['storage'] setting, and if set then add your checkboxes.
<br>
<br>
I suggest looking at the form_example_wizard in the examples module, as that's basically what you are after, even though it's not a typical multi-step wizard you are after, the logic is still the same.
<br>
<br>
<u></u><u></u></p>
<pre>Jamie Holly<u></u><u></u></pre>
<pre><a href="http://hollyit.net" target="_blank">http://hollyit.net</a><u></u><u></u></pre>
<p class="MsoNormal">On 2/11/2015 10:43 AM, Jeff Greenberg wrote:<u></u><u></u></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">One thing that is either part of the issue, or a separate issue that impacts this, is that the checkboxes field is added via hook_form_alter. I notice that although the field appears in $form_state[values] it does not appear in $form_state[field],
so I'm wondering where $form_state gets the information for the field when rebuilding the form.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Wed, Feb 11, 2015 at 9:31 AM, Jeff Greenberg <<a href="mailto:listmail.ayendesigns@gmail.com" target="_blank">listmail.ayendesigns@gmail.com</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in;vertical-align:baseline">
I have a node form that contains a checkboxes field with options NULL at the time the form is displayed.<u></u><u></u></p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in;vertical-align:baseline">
During node_validate, if certain criteria is met, an array of options (checkboxes) is created, and the form needs to be redisplayed with the checkboxes as part of it.<u></u><u></u></p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in;vertical-align:baseline">
I've tried setting #options = the new array in the $form, in $form_state[original_form], etc all to no avail. The field doesn't change.<u></u><u></u></p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in;vertical-align:baseline">
I also set one checkbox in the field at the start, so that I could find it in the $form and $form_state structures, changed where I found it to the new options array, and again, no change. I am setting $form_state[rebuild] to true, and even tried explicitly
calling for the form to be rebuilt.<u></u><u></u></p>
<div>
<p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p>
</div>
<p class="MsoNormal"><span><span style="color:#888888">-- </span><u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="color:#888888">--- </span><u></u><u></u></p>
<div>
<p class="MsoNormal"><span style="color:#888888"><a href="http://drupal.org/user/367108" target="_blank">drupal.org/user/367108</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><a href="http://linkedin.com/in/jeffrgreenberg" target="_blank">linkedin.com/in/jeffrgreenberg</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><a href="http://accidentalcoder.com" target="_blank">accidentalcoder.com</a> /
<a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888">@accidentalcoder<u></u><u></u></span></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span style="color:#888888"><br>
<br clear="all">
</span><span><u></u><u></u></span></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"><span><span style="color:#888888">-- </span><u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="color:#888888">--- </span><u></u><u></u></p>
<div>
<p class="MsoNormal"><span style="color:#888888"><a href="http://drupal.org/user/367108" target="_blank">drupal.org/user/367108</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><a href="http://linkedin.com/in/jeffrgreenberg" target="_blank">linkedin.com/in/jeffrgreenberg</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><a href="http://accidentalcoder.com" target="_blank">accidentalcoder.com</a> /
<a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888">@accidentalcoder<u></u><u></u></span></p>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
</blockquote>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"><br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<p class="MsoNormal">---<u></u><u></u></p>
<div>
<p class="MsoNormal"><a href="http://drupal.org/user/367108" target="_blank">drupal.org/user/367108</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://linkedin.com/in/jeffrgreenberg" target="_blank">linkedin.com/in/jeffrgreenberg</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://accidentalcoder.com" target="_blank">accidentalcoder.com</a> /
<a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">@accidentalcoder<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
<br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">---<div><a href="http://drupal.org/user/367108" target="_blank">drupal.org/user/367108</a></div><div><a href="http://linkedin.com/in/jeffrgreenberg" target="_blank">linkedin.com/in/jeffrgreenberg</a></div><div><a href="http://accidentalcoder.com" target="_blank">accidentalcoder.com</a> / <a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a></div><div>@accidentalcoder</div></div>
</div>