dissecting the og module - where is the content type form submit handler for function og_ui_form_node_type_form_alter?
-
16-10-2019 - |
Question
drupal version: 7
Hi, I'm trying to add settings to a content type form and I'm using organic groups as a guide. I see the form elements for OG being added in the og_ui.module at line 316 in this function og_ui_form_node_type_form_alter
but I don't see where these form elements are being submitted, handled, saved, processed... I would've expected it to add another submit handler to the form but it doesn't seem to be the case. Anyone have any experience with this?
Solution
This happens automatically.
Adding a variable to that form means that it is automatically saved with variable_set()
with a _node_type
suffix. Similar to admin forms.
Here is another example: userpoints_nc_visits_form_node_type_form_alter().
As you can see, the form element is for example named userpoints_nc_visits_points
and the default value is fetched with userpoints_nc_visits_points_type
(inside the get setting api function).