http://api.drupal.org/api/drupal/modules--translation--translation.modul...

This says it is implementing hook_form_alter(), but it is actully now hook_form_BASE_FORM_ID_alter().

See
http://api.drupal.org/api/search/7/node_form_alter
for other examples.

The docblock just needs a quick update -- good project for a novice doc contributor.

CommentFileSizeAuthor
#1 988318.patch885 bytesjhodgdon

Comments

jhodgdon’s picture

Status: Active » Needs review
Issue tags: -Novice
StatusFileSize
new885 bytes

Here's a patch. It looks like when the former form_alter() function was split into two pieces, the doc wasn't updated.

Status: Needs review » Needs work

The last submitted patch, 988318.patch, failed testing.

jhodgdon’s picture

Status: Needs work » Needs review

This failure is due to:
#990814: Intermittent test failures in field.test
which I HOPE will be fixed soon.

jhodgdon’s picture

#1: 988318.patch queued for re-testing.

elrayle’s picture

#1: 988318.patch queued for re-testing.

elrayle’s picture

Status: Needs review » Reviewed & tested by the community

Correctly updated to describe the function as an override of hook_form_FORM_ID_alter() which allows modification of a specific form, in this case the node edit form, rather than implementing hook_form_alter() and checking the form ID, or using long switch statements to alter multiple forms.

drewish’s picture

yeah looks good.

jhodgdon’s picture

Version: 7.x-dev » 8.x-dev

Needs to go to d8 and then d7

dries’s picture

Status: Reviewed & tested by the community » Needs work

It would be better if the documentation described why/how the form is altered. Is that a change we can make?

jhodgdon’s picture

Status: Needs work » Reviewed & tested by the community

It does say:

+ * This function alters language fields on node edit forms when a translation is
+ * about to be created.

I'm not sure what more needs to be said -- what do you think is missing?

dries’s picture

Version: 8.x-dev » 7.x-dev

Agreed that is OK as is. I don't want to hold up this simple correction, so I committed to my local 8.x tree which I'll push out later tonight. Moving to 7.x in the mean time. Thanks!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x. Thanks!

Status: Fixed » Closed (fixed)

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