Fixed FWN beat titling

Paul Frields stickster at gmail.com
Sun Oct 17 20:28:51 UTC 2010


Pascal et al.,

I've fixed the function to get FWN beats a title based on their issue
# and beat. The node will get a title like "FWN 250 - Introduction".

What took me a while was figuring out that CCK content types have a
different array structure than the standard content types. In regular
Drupal content types, you can set a value with:

$form_state['values']['field_name'] = "New stuff";

However, the structure of CCK field means that you have to do some
fancier referencing:

$form_state['values']['field_name'][0]['value'] = "New stuff";

When I tried this at first and found it worked, I was worried that
type of referencing was somehow weird, but it turns out it was in fact
correct.

Note that this title setting doesn't retroactively change old beats --
it works during the form validation process (after initial entry and
before the items are submitted to the database), so it will only apply
to new content being created.

Paul


More information about the logistics mailing list