<div>On Wed, Oct 3, 2012 at 2:39 PM, Earnie Boyd <span dir="ltr"><<a href="mailto:earnie@users.sourceforge.net" target="_blank">earnie@users.sourceforge.net</a>></span> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Tue, Oct 2, 2012 at 4:30 PM, Wipe_Out wrote:<br>
> On 2 October 2012 19:57, Earnie Boyd <<a href="mailto:earnie@users.sourceforge.net">earnie@users.sourceforge.net</a>> wrote:<br>
>><br>
>> On Tue, Oct 2, 2012 at 2:23 PM, Wipe_Out <<a href="mailto:wipe_out@users.sourceforge.net">wipe_out@users.sourceforge.net</a>><br>
>> wrote:<br>
>> > On 2 October 2012 17:59, Michael Prasuhn <<a href="mailto:mike@mikeyp.net">mike@mikeyp.net</a>> wrote:<br>
>> >><br>
>> >> How are you updating the field?<br>
>> >> __________________<br>
>> >> Michael Prasuhn<br>
>> >> <a href="http://mikeyp.net" target="_blank">http://mikeyp.net</a><br>
>> >><br>
>> ><br>
>> > Directly in the database..<br>
>> ><br>
>> > I know its bad and it means none of the Drupal hooks run but its the<br>
>> > only<br>
>> > way we could do this one particular update easily and in testing other<br>
>> > than<br>
>> > it not displaying immediately it doesn't seem to have any adverse<br>
>> > effects..<br>
>><br>
>> By directly do you mean using SQL or node_load/node_save? You should<br>
>> never use SQL to directly update the node. You may programmatically<br>
>> update it using node_load, modify object parameter then follow with<br>
>> node_save. This allows all the other node hooks to operate properly.<br>
><br>
</div><div class="im">> Yes I know but in this case we didn't have a choice so had to try it.. Its<br>
> just updating a datetime field with a new value.. The testing we did didn't<br>
> reveal any issues other than the fact that the cache needs to be cleared for<br>
> the new values to show in Drupal..<br>
><br>
> Originally we tried updating with a CSV through the feeds module but there<br>
> is a timezone bug in feeds that stops this working..<br>
<br>
</div>The node_save() would DTRT with the cache record.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Earnie<br>
-- <a href="https://sites.google.com/site/earnieboyd" target="_blank">https://sites.google.com/site/earnieboyd</a><br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</div></div></blockquote></div><br>If you can do a bootstrap and assuming you know the nid, you can use<div><pre class="php" style="font-size:13px;border:0px;background-color:rgb(246,246,242);margin-top:0px;margin-bottom:0px;padding:1px;vertical-align:baseline;font-family:'courier new',courier,'lucida console';white-space:pre-wrap;overflow:auto;color:rgb(34,34,34)">
<code style="border:0px;background-color:rgb(248,248,250)!important;font-size:12px!important;margin:0px;padding:0px!important;vertical-align:baseline;font-family:'Courier New','Bitstream Vera Sans Mono',Monaco,'Lucida Console',monospace!important;line-height:15px"> <span class="php-function-or-constant" style="border:0px;background-color:transparent;margin:0px;padding:0px;vertical-align:baseline;color:rgb(0,0,170)"><a href="http://api.drupal.org/api/drupal/includes%21common.inc/function/entity_get_controller/7" title="Get the entity controller class for an entity type." class="local" style="border:0px;background-color:transparent;margin:0px;padding:0px;vertical-align:baseline;color:rgb(0,0,170);text-decoration:none;font-weight:bold">entity_get_controller</a></span>(<span class="php-string" style="border:0px;background-color:transparent;margin:0px;padding:0px;vertical-align:baseline;color:rgb(170,0,0)">'node'</span>)-><span class="php-function-or-constant" style="border:0px;background-color:transparent;margin:0px;padding:0px;vertical-align:baseline;color:rgb(0,0,170)"><a href="http://api.drupal.org/api/search/7/resetCache" title="Multiple implementations exist." class="local" style="border:0px;background-color:transparent;margin:0px;padding:0px;vertical-align:baseline;color:rgb(0,0,170);text-decoration:none;font-weight:bold">resetCache</a></span>(<span class="php-keyword" style="border:0px;background-color:transparent;margin:0px;padding:0px;vertical-align:baseline;color:rgb(0,102,0)">array</span>(<span class="php-variable" style="border:0px;background-color:transparent;margin:0px;padding:0px;vertical-align:baseline;color:rgb(51,51,0)">$node</span>-><span class="php-function-or-constant" style="border:0px;background-color:transparent;margin:0px;padding:0px;vertical-align:baseline;color:rgb(0,0,170)"><a href="http://api.drupal.org/api/search/7/nid" title="Multiple implementations exist." class="local" style="border:0px;background-color:transparent;margin:0px;padding:0px;vertical-align:baseline;color:rgb(0,0,170);text-decoration:none;font-weight:bold">nid</a></span>));
</code></pre><div>or</div><div><pre class="php" style="border:0px;background-color:rgb(246,246,242);font-size:13px;margin-top:0px;margin-bottom:0px;padding:1px;vertical-align:baseline;font-family:'courier new',courier,'lucida console';white-space:pre-wrap;overflow:auto;color:rgb(34,34,34)">
<code style="border:0px;background-color:rgb(248,248,250)!important;font-size:12px!important;margin:0px;padding:0px!important;vertical-align:baseline;font-family:'Courier New','Bitstream Vera Sans Mono',Monaco,'Lucida Console',monospace!important;line-height:15px"> <span class="php-function-or-constant" style="border:0px;background-color:transparent;margin:0px;padding:0px;vertical-align:baseline;color:rgb(0,0,170)"><a href="http://api.drupal.org/api/search/6/cache_clear_all" title="Multiple implementations exist." class="local" style="border:0px;background-color:transparent;margin:0px;padding:0px;vertical-align:baseline;color:rgb(0,0,170);text-decoration:none;font-weight:bold">cache_clear_all</a></span>();
</code></pre></div><div>if you're using Drupal 6.</div></div><div><br></div>-- <br>Christian López Espínola <br>Área de Proyectos <br><br>Emergya Consultoría <br>Tfno: +34 954 51 75 77 <br>Fax: +34 954 51 64 73 <br><a href="http://www.emergya.es" target="_blank">www.emergya.es</a><br>