I am rather new to Drupal.
I came across 2 methods to pre-populate a form, namely hook_form_alter() and hook_prepare()
I have read the docs, and I believe that both methods can achieve what I want.
I was wondering what were these 2 functions created for? Is there one that is made for a designated function or so?
As far as I understand, hook_form_alter() takes the current form state, and acts on it. Does this mean that this function is made to alter the actual form itself? Like changing certain fields, or adding custom fields and so on?
Hook_prepare() on the other hand, takes a node and acts on it before it populates the add/edit form.
Assume the case is that I am trying to pre-populate a form. Would hook_prepare() be the "right" way to do it? Or it really just doesnt matter? And what if I am using the webform module, rather than a content type?