The constants FIELD_BEHAVIOR_* in modules/field/field.module currently just say TODO in the description field. That's not exactly ideal.

CommentFileSizeAuthor
#11 993852-try4.patch1.69 KBAnonymous (not verified)
#9 993852-try3.patch1.49 KBAnonymous (not verified)
#8 993852-try3.patch1.49 KBAnonymous (not verified)
#6 993852.patch1.27 KBAnonymous (not verified)
#3 3816350.patch1.25 KBAnonymous (not verified)

Comments

jhodgdon’s picture

Issue tags: +Novice

Probably a good novice project. Just need to figure out what the constants are being used for, and describe it in a sentence.

Anonymous’s picture

Assigned: Unassigned »

Ill do this one!

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new1.25 KB

Wrote some stuff up, i hope the array name $field is right. Was unsure about it for a while.

Anonymous’s picture

jhodgdon’s picture

Status: Needs review » Needs work

The information looks correct to me, but the formatting is not correct. Please check out
http://drupal.org/node/1354
The first line of any docblock should be a one-line, one-sentence summary, and then there should be a blank line, followed by other necessary information. Also, all lines should be wrapped as close to 80 characters as possible; if you need a new paragraph, leave a blank line.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new1.27 KB

Going again, might need more input though.

jhodgdon’s picture

Status: Needs review » Needs work

I forgot to mention it before, but we should have a blank line between the end of one function/define/etc. and the next /** line.

This block also needs to start with a single one-line 80-character sentence description:

 /**
- * TODO
+ * Value for $field['behaviors']['default value'] indicating no support
+ * for default values.
  */
 define('FIELD_BEHAVIOR_NONE', 0x0001);

I also think the description line for this one is misleading, since this constant is used both for default value and multiple values:

 /**
- * TODO
+ * Value for $field['behaviors']['default value'] concerning default values.
+ *
+ * This value indicates that the widget accepts default values.
+ *
+ * Also a value for $field['behaviors']['multiple values'].
+ *
+ * Indicates that the widget will be repeated for each value input if it allows
+ * the input of one single field value.
  */

I guess generally the first-line summaries should summarize what the constant is used for. They should generally be plain text, and not have things like $field[] in them. So I think the information you have is good, but it needs a bit of rewriting to be prose instead of symbols. Thanks!

Anonymous’s picture

StatusFileSize
new1.49 KB
Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new1.49 KB

There is a new one, corrected another field also using the ugly $field[] and breaking plain text.

EDIT: doh, included the patch twice. :)

jhodgdon’s picture

Getting closer!

- api => API (acronyms should be all-caps).
- doesnt => doesn't
- I think one line of the patch is longer than 80 characters, but I wasn't sure because I couldn't get it to apply to HEAD.
- I thought the longer description for FIELD_BEHAVIOR_DEFAULT was a bit confusing. Maybe reformulate something like this:

If used in a widget default context, indicates the widget accepts default values. If used in .... (etc.)

- Should all of these constants have a @see that points you to the function/hook where they are used, which I guess is hook_field_widget_info()? That might be helpful.

Anonymous’s picture

StatusFileSize
new1.69 KB

Here goes again, corrected the errors and added @see as you proposed. Hope it applies to HEAD now too.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

That looks fine to me.

I can't seem to apply the patch still, and I figured out what the problem is.

In my patching environment (I use Eclipse), if there is a blank line of context (i.e. a line that isn't changed in the patch), the patch file has a single space on the line (in the column where the +/- signs go). Yours seems to make the line totally blank. Mine expects that space to be there, and if I add spaces to the totally blank lines, I can get the patch to apply.

The testing bot doesn't seem to care one way or the other (it seems to like both patches you create and patches I create). But that's why I can't apply your patches.

Anyway, all of that is an aside. I think we should get this patch in, and thanks!

jhodgdon’s picture

FYI:
http://www.gnu.org/software/hello/manual/diff/Detailed-Unified.html#Deta...
It does say "The lines common to both files begin with a space character." nenne: Just out of curiosity, what system are you using to create your patches?

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Great work, nenne!

Committed to HEAD. Thanks!

Anonymous’s picture

Jhodgdon: i use "cvs diff -up [file] > [patch]" to create the patches.

Version "1:1.12.13-12ubuntu1" of cvs on Lucid Lynx.

jhodgdon’s picture

That's very odd. When I use the same command on my Ubuntu box (same version of CVS, but it's probably the diff command that is making the patches -- but probably the same version of diff as you have), the blank context lines have a single space at the end. Hmmm.

Status: Fixed » Closed (fixed)
Issue tags: -Novice

Automatically closed -- issue fixed for 2 weeks with no activity.