[development] losing value somewhere after validate.

Darrel O'Pry dopry at thing.net
Fri Jun 16 18:40:37 UTC 2006


Sammy, use prepare to modify data. and validate to validate only...
Changes will get lost between validate and insert/update


On Fri, 2006-06-16 at 01:33 +1000, sime wrote:
> OK, I found the document that describes differences between 4.6 and 4.6. 
> It states that I cannot change a value on validation.*
> 
> *http://drupal.org/node/22218
> 3. validate (you can only validate here, no changes possible)
> 
> 
> This conflicts with the nodeapi docs:
> 
> http://api.drupal.org/api/HEAD/function/hook_nodeapi
> "validate": ... This hook can be used to check or even modify the node
> 
> 
> Should I assume that the first one is correct? This would mean that I am 
> just encountering legacy 4.6 code in ecommerce 4.7. Sorry, I'm finding 
> this hard to get my head around.
> 
> .s
> 
> 
> 
> sime wrote:
> 
> > Hello.
> >
> > I keep losing values that I modify in the 'validate' op of 
> > hook_nodeapi(). This occurs by the time I get to the insert or update 
> > ops.
> >
> > It has to be something simple I am overlooking. I normally wouldn't 
> > hassle the list over such things, but I am starting to write bad code 
> > to compensate, so I need to work out what I'm doing wrong. It is a 
> > little hard for me to track the $node through core, so are there any 
> > suggestions about what I might be doing wrong, or where a problem like 
> > this can arise?
> >
> > Kind thanks for any advice.
> > Simon
> >
> > PS.
> > I have checked the nodeapi docs:
> > "validate": The user has just finished editing the node and is trying 
> > to preview or submit it. This hook can be used to check or *even 
> > modify the node*.
> >
> > Also, I have double-checked that i am using a version of form.inc that 
> > is after this issue was fixed: http://drupal.org/node/63704
> >
> >
> >
> 
> 



More information about the development mailing list