<div dir="ltr"><div><div>You need to change submit type from "button" to "submit". For some reason it's not getting triggered.<br><br></div>See discussion <a href="https://drupal.org/node/72855">https://drupal.org/node/72855</a>.<br>
<br></div>The working one for you should be like<br>$form['actions']['submit'] = array(<br> '#type' => 'submit',<br> '#value' => t('Submit'),<br> '#submit' => array('night_pharmacy_form_submit'),<br>
);<br><br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 December 2013 22:48, Muzaffer Tolga Ozses <span dir="ltr"><<a href="mailto:tolga@ozses.net" target="_blank">tolga@ozses.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:'courier new',monospace">Unbelievable, night_pharmacy_form_submit doesn't even get hit :S . See <a href="http://git.webciniz.im/?p=project/night_pharmacy.git;a=blob;f=night_pharmacy.module;h=b0fecaef686cc458f946e4ab69bbfd81d5f8be25;hb=refs/heads/2013120501#l57" target="_blank">http://git.webciniz.im/?p=project/night_pharmacy.git;a=blob;f=night_pharmacy.module;h=b0fecaef686cc458f946e4ab69bbfd81d5f8be25;hb=refs/heads/2013120501#l57</a> please</div>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 December 2013 16:55, Paolo Mainardi <span dir="ltr"><<a href="mailto:paolo@twinbit.it" target="_blank">paolo@twinbit.it</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Muzaffer,<div><br></div><div>You should consider to refactor using drupal coding standard, example from comment module:</div><div><br></div><div><div> $form['actions'] = array('#type' => 'actions');</div>
<div>
<div> $form['actions']['submit'] = array(</div></div><div> '#type' => 'submit',</div><div> '#value' => t('Save'),</div><div> '#access' => ($comment->cid && user_access('administer comments')) || variable_get('comment_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_REQUIRED || isset($form_state['comment_preview']),</div>
<div> '#weight' => 19,</div><div> );</div><div> $form['actions']['preview'] = array(</div><div> '#type' => 'submit',</div><div> '#value' => t('Preview'),</div>
<div> '#access' => (variable_get('comment_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_DISABLED),</div><div> '#weight' => 20,</div><div> '#submit' => array('comment_form_build_preview'),</div>
<div> );</div></div><div><br></div><div><a href="https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#actions" target="_blank">https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#actions</a><br>
</div><div><br></div><div>Why you need to call a specific submit function, as you'll have for free "night_pharmacy_form_submit($form, &$form_state)" already executed by Drupal ?</div><div><br></div><div>
<br></div></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On Wed, Dec 4, 2013 at 3:46 PM, Muzaffer Tolga Ozses <span dir="ltr"><<a href="mailto:tolga@ozses.net" target="_blank">tolga@ozses.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">So, what else can I check?</div></div>
<div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 December 2013 15:24, Murat Günana <span dir="ltr"><<a href="mailto:mgunana@gmail.com" target="_blank">mgunana@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">According to the form api it should be able to do that.<br></div><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">On 4 December 2013 13:17, John Morahan <span dir="ltr"><<a href="mailto:john.morahan@gmail.com" target="_blank">john.morahan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">'#type' => 'button' won't execute a submit callback, try '#type' => 'submit'</div>
<div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 December 2013 13:16, Murat Günana <span dir="ltr"><<a href="mailto:mgunana@gmail.com" target="_blank">mgunana@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>You shouldn't return anything in the callback function. you need to remove "return $source" line from there.<br>
</div>Just for test purposes put this line in callback function and see if you can get any form error <span style="margin:0px;padding:0px;border:0px none;font-family:'Bitstream Vera Sans Mono',Monaco,'Lucida Console',monospace;font-style:normal;font-variant:normal;font-weight:normal;line-height:17.9844px;font-size:12px;vertical-align:baseline;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;background-color:rgb(246,246,242);color:rgb(0,0,187)">form_set_error</span><span style="margin:0px;padding:0px;border:0px none;font-family:'Bitstream Vera Sans Mono',Monaco,'Lucida Console',monospace;font-style:normal;font-variant:normal;font-weight:normal;line-height:17.9844px;font-size:12px;vertical-align:baseline;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;background-color:rgb(246,246,242);color:rgb(0,119,0)">(</span><span style="margin:0px;padding:0px;border:0px none;font-family:'Bitstream Vera Sans Mono',Monaco,'Lucida Console',monospace;font-style:normal;font-variant:normal;font-weight:normal;line-height:17.9844px;font-size:12px;vertical-align:baseline;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;background-color:rgb(246,246,242);color:rgb(221,0,0)">'iller_select'</span><span style="margin:0px;padding:0px;border:0px none;font-family:'Bitstream Vera Sans Mono',Monaco,'Lucida Console',monospace;font-style:normal;font-variant:normal;font-weight:normal;line-height:17.9844px;font-size:12px;vertical-align:baseline;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;background-color:rgb(246,246,242);color:rgb(0,119,0)">, </span><span style="margin:0px;padding:0px;border:0px none;font-family:'Bitstream Vera Sans Mono',Monaco,'Lucida Console',monospace;font-style:normal;font-variant:normal;font-weight:normal;line-height:17.9844px;font-size:12px;vertical-align:baseline;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;background-color:rgb(246,246,242);color:rgb(221,0,0)">'Error.'</span><span style="margin:0px;padding:0px;border:0px none;font-family:'Bitstream Vera Sans Mono',Monaco,'Lucida Console',monospace;font-style:normal;font-variant:normal;font-weight:normal;line-height:17.9844px;font-size:12px;vertical-align:baseline;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;background-color:rgb(246,246,242);color:rgb(0,119,0)">);</span></div>
<div><div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On 4 December 2013 12:59, Muzaffer Tolga Ozses <span dir="ltr"><<a href="mailto:tolga@ozses.net" target="_blank">tolga@ozses.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_default"><font face="courier new, monospace">Look at <a href="http://git.webciniz.im/?p=project/night_pharmacy.git;a=blob;f=night_pharmacy.module;h=49adff05adea3549c4566c2cb2ec2ce2f6d5db08;hb=16ee60869975ca8794abc193e0713376945c0c02#l54" target="_blank">http://git.webciniz.im/?p=project/night_pharmacy.git;a=blob;f=night_pharmacy.module;h=49adff05adea3549c4566c2cb2ec2ce2f6d5db08;hb=16ee60869975ca8794abc193e0713376945c0c02#l54</a> . I made the changes you suggested and no dice :S</font><br>
</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 December 2013 14:54, Murat Günana <span dir="ltr"><<a href="mailto:mgunana@gmail.com" target="_blank">mgunana@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>implement your form submit element like;<br>$form['actions']['submit'] = array(<br>
'#type' => 'button',<br> '#value' => t('Submit'),<br> '#submit' => array('night_pharmacy_table'),<br>
);<br></div>and make sure you clear the cache.<br></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On 4 December 2013 12:49, Muzaffer Tolga Ozses <span dir="ltr"><<a href="mailto:tolga@ozses.net" target="_blank">tolga@ozses.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">Thanks Patrick,</div><div class="gmail_default" style="font-family:courier new,monospace">
<br></div><div class="gmail_default" style="font-family:courier new,monospace">
Unfortunately, night_pharmacy_table never gets called, and I have no clue why. Do you happen to have an idea?</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 December 2013 14:35, Patrick Dawkins <span dir="ltr"><<a href="mailto:pjcdawkins@gmail.com" target="_blank">pjcdawkins@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">night_pharmacy_table is a form submit callback. It already gets passed the $form parameter; you have got the function signature wrong.<div>
<br></div><div><div>So you need to change<div><div>function night_pharmacy_table($form_state) {</div>
<div>to</div><div>function night_pharmacy_table($form, &$form_state) {</div></div></div><div><br></div><div><br></div><div>Documentation here: <a href="https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#submit_property" target="_blank">https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#submit_property</a><div>
<br></div></div><div><br></div></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 December 2013 12:14, Muzaffer Tolga Ozses <span dir="ltr"><<a href="mailto:tolga@ozses.net" target="_blank">tolga@ozses.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:'courier new',monospace">Hi,</div><div class="gmail_default" style="font-family:'courier new',monospace">
<br></div><div class="gmail_default" style="font-family:'courier new',monospace">
This is really a PHP question, but it involves $form_state, so bear with me please.</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">
In my code at <a href="http://git.webciniz.im/?p=project/night_pharmacy.git;a=blob;f=night_pharmacy.module;h=132b5d4a90692acfadfe9e11af128f712df1c24d;hb=e89e63bb07f064898ca21be1c97aba221b4dbdaf#l57" target="_blank">http://git.webciniz.im/?p=project/night_pharmacy.git;a=blob;f=night_pharmacy.module;h=132b5d4a90692acfadfe9e11af128f712df1c24d;hb=e89e63bb07f064898ca21be1c97aba221b4dbdaf#l57</a> I want to be able to pass $form parameters to night_pharmacy_table, to no avail. Can you help me guys?</div>
<div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">Thanks in advance :)</div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br><br clear="all"><br></div></div><div>-- <br>Kind regards,<br><br>Murat Gunana<br>Tel: <a href="tel:07927964976" value="+3907927964976" target="_blank">07927964976</a><br>Email: <a href="mailto:mgunana@gmail.com" target="_blank">mgunana@gmail.com</a><br>
</div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Kind regards,<br><br>Murat Gunana<br>Tel: <a href="tel:07927964976" value="+3907927964976" target="_blank">07927964976</a><br>Email: <a href="mailto:mgunana@gmail.com" target="_blank">mgunana@gmail.com</a><br>
</div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Kind regards,<br><br>Murat Gunana<br>Tel: <a href="tel:07927964976" value="+3907927964976" target="_blank">07927964976</a><br>Email: <a href="mailto:mgunana@gmail.com" target="_blank">mgunana@gmail.com</a><br>
</div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div><a href="http://twinbit.it/" style="color:rgb(17,85,204);font-family:Consolas,Menlo,Monaco,'Andale Mono WT','Andale Mono','Lucida Console','Lucida Sans Typewriter','DejaVu Sans Mono','Bitstream Vera Sans Mono','Liberation Mono','Nimbus Mono L','Courier New',Courier,monospace;font-size:x-small" target="_blank"><img alt="TWINBIT logo" border="0" height="46" width="200"></a><span style="font-family:Consolas,Menlo,Monaco,'Andale Mono WT','Andale Mono','Lucida Console','Lucida Sans Typewriter','DejaVu Sans Mono','Bitstream Vera Sans Mono','Liberation Mono','Nimbus Mono L','Courier New',Courier,monospace;font-size:x-small"> </span><br style="font-family:Consolas,Menlo,Monaco,'Andale Mono WT','Andale Mono','Lucida Console','Lucida Sans Typewriter','DejaVu Sans Mono','Bitstream Vera Sans Mono','Liberation Mono','Nimbus Mono L','Courier New',Courier,monospace;font-size:x-small">
<br style="font-family:Consolas,Menlo,Monaco,'Andale Mono WT','Andale Mono','Lucida Console','Lucida Sans Typewriter','DejaVu Sans Mono','Bitstream Vera Sans Mono','Liberation Mono','Nimbus Mono L','Courier New',Courier,monospace;font-size:x-small">
<font style="font-family:arial,helvetica,sans-serif;color:rgb(51,51,51)"><font size="4">Paolo Mainardi</font> <br></font><i>Twinbit Founder - CTO<br style="font-family:Consolas,Menlo,Monaco,'Andale Mono WT','Andale Mono','Lucida Console','Lucida Sans Typewriter','DejaVu Sans Mono','Bitstream Vera Sans Mono','Liberation Mono','Nimbus Mono L','Courier New',Courier,monospace;font-size:x-small">
</i><br style="font-family:Consolas,Menlo,Monaco,'Andale Mono WT','Andale Mono','Lucida Console','Lucida Sans Typewriter','DejaVu Sans Mono','Bitstream Vera Sans Mono','Liberation Mono','Nimbus Mono L','Courier New',Courier,monospace;font-size:x-small">
<font style="font-family:Consolas,Menlo,Monaco,'Andale Mono WT','Andale Mono','Lucida Console','Lucida Sans Typewriter','DejaVu Sans Mono','Bitstream Vera Sans Mono','Liberation Mono','Nimbus Mono L','Courier New',Courier,monospace" color="#666666" face="Consolas, Menlo, Monaco, Courier New, Courier, monospace"><font face="Consolas, Menlo, Monaco, Courier New, Courier, monospace"><b>www</b>: <a href="http://twinbit.it/" style="color:rgb(241,126,14)" target="_blank">twinbit.it</a></font> <br>
<font face="Consolas, Menlo, Monaco, Courier New, Courier, monospace"><b>mobile</b>: <a value="+393895122611" style="color:rgb(17,85,204)">(+39) 3401678089</a></font> <br><font face="Consolas, Menlo, Monaco, Courier New, Courier, monospace"><b>skype</b>: paolo_mainardi</font> <br>
<font face="Consolas, Menlo, Monaco, Courier New, Courier, monospace"><b>linkedin</b>: <a href="http://www.linkedin.com/in/paolomainardi" style="color:rgb(241,126,14)" target="_blank">paolomainardi</a></font> <br><font face="Consolas, Menlo, Monaco, Courier New, Courier, monospace"><b>twitter</b>: <a href="http://twitter.com/paolomainardi" style="color:rgb(241,126,14)" target="_blank">@paolomainardi</a></font> <br>
<font face="Consolas, Menlo, Monaco, Courier New, Courier, monospace"><b>blog</b>: <a href="http://paolomainardi.com/" style="color:rgb(241,126,14)" target="_blank">paolomainardi.com</a></font> <br></font></div>
</font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Kind regards,<br><br>Murat Gunana<br>Tel: 07927964976<br>Email: <a href="mailto:mgunana@gmail.com" target="_blank">mgunana@gmail.com</a><br>
</div>