[documentation] [bug] Error in Forms API Quick Start Guide

webchick drupal-docs at drupal.org
Thu Mar 23 04:42:57 UTC 2006


Issue status update for 
http://drupal.org/node/54835
Post a follow up: 
http://drupal.org/project/comments/add/54835

 Project:      Documentation
 Version:      <none>
 Component:    Developer Guide
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  fgm
 Updated by:   webchick
 Status:       patch (code needs review)

I talked to chx about this the other day... the deal is we need to
remove references to obtaining $edit via $_POST['edit'], not change the
actual #default_value thing. Unfortunately this is not as simple as just
erasing all instances of $_POST['edit']; it requires re-writing some of
the text.




webchick



Previous comments:
------------------------------------------------------------------------

Sun, 19 Mar 2006 22:01:26 +0000 : fgm

Attachment: http://drupal.org/files/issues/forms_api.html.patch (1.89 KB)

The first example in the Forms API Quick Start Guide at
http://drupaldocs.org/api/head/file/contributions/docs/developer/topics/forms_api.html


includes this line: #default_value' => $edit['foo'],


but according to chx, it is better practice to use #default_value' =>
'foo', instead. The suggested patch fixes this example.


As this is one of the very first examples developers on the learning
will read about 4.7, it seems important to make sure the code matches
best current practices.




------------------------------------------------------------------------

Mon, 20 Mar 2006 01:58:27 +0000 : webchick

Hm. Really? $edit['foo'] and 'foo' are not the same thing. One is saying
"The $foo variable that was submitted with the form" the other is saying
"Make it literally the word 'foo'."


I'll talk to chx about this next time I see him to see if he can
clarify this.






More information about the documentation mailing list