Problem/Motivation

The hook_form_alter implementation is executed on forms where it should not have. hook_form_alter is invoked for all the forms, but we only need to alter the node form at this point.

Proposed resolution

Rename onlyone_form_alter function to onlyone_form_node_form_alter (implementing hook_form_BASE_FORM_ID_alter), that function is guaranteed to be called only node edit/add forms. An we can also access the full node object and its type (even on node-add forms) and eliminate the use of the substr function.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

adriancid created an issue. See original summary.

  • adriancid committed d694138 on 7.x-1.x
    Issue #2860686 by adriancid: Change the hook_form_alter hook by the...
adriancid’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

adriancid credited Ayesh.

adriancid’s picture