This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

simplenews and full name field when suscribing

I already have a form that I was using to suscribe to a newsletter (using webform module) and I read in the simplenews features that you can suscribe
"to the newsletters is managed through blocks, and/or a subscription form, and/or a custom page" but I can't find how to connect them... :-\

Is there a setting or a way to add an edit field for "Full Name" when suscribing to the newsletter?.. OR how can I use the webform I already have?

Thanks!

Function to get the Drupal Version?

Just curious are there any functions or variables to get the Drupal's version in place? This could be very useful when people try to develop a version-independent module.

Stock Module

Has anyone been able to, or will we soon be able to implement the stock and stock.api module into 4.7?

hook_nodeapi and form validation

I am using Drupal 4.7b4 and am having a problem with hook_nodeapi('validate'...) that I am really hoping someone can shed some light on.

I am using hook_nodeapi and hook_form_alter to add an image upload function to some of my existing nodetypes. My code works fine except if I preview a node before submitting it.

The problem is that hook_nodeapi('validate'...) is being called multiple times. My code looks as follows:

case 'validate':
if ($file = file_check_upload('nodeimage_upload'))
{
   $file = file_save_upload('_upload', _get_filename($file->filename), FILE_EXISTS_RENAME);
   ...
}

The first time $op='validate' is called, everything works fine, except that file_save_upload() removes the temporary file created when the node is submitted.
What this means is that for every subsequent call of hook_nodeapi('validate'...), I get the following error:
"The selected file could not be copied, because no file by that name exists. Please check that you supplied the correct filename."

I have read the forums and everthing else that I can find in the docs and I still cant find out how to fix my problem. Very similar code in 4.6 worked fine. Is this a bug, a new feature introduced in 4.7 or simply a huge gap in my understanding?

The sequence of nodeapi calls I am getting is as follows:

  • load
  • prepare
  • validate
  • view
  • validate

Aggregator2 is it possible to make feed items a blog post

Is it at all possible to get Aggregator2 to post each item as a blog post in a certain blog rather than a news item?

how to retrieve the day select in the new date type form API?

Hello, I have a problem with this, I'm creating a module, and I put this in the form hook:

$form['group']['date1'] = array('#type' => 'date','#title' => t('Date1'),'#default_value' =>$edit[$form->fecha_carrera],'#required' => TRUE);

and then, in the insert hook I need to retrieve the selected day by the user... but if I do this (is an example):

$datetoinsert=$node->date1;
echo $datetoinsert;

I obtain "array", instead of the selected day by the user.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions