Closed (fixed)
Project:
Signup
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
16 May 2008 at 14:43 UTC
Updated:
6 Oct 2010 at 11:00 UTC
Jump to comment: Most recent file
I want to use Signup without additional form fields. I removed all fields within theme:
function theme_signup_user_form() {
$form['signup_form_data']['#tree'] = TRUE;
return $form;
}
When i hit the 'Sign up' button this results in an error telling
warning: array_merge() [function.array-merge]: Argument #1 is not an array in /www/.../modules/signup/signup.module on line 1360.
Signup works as expected but this error always appears.
What is the best practise on removing all form fields as used at groups.drupal.org?
Thanks, Ronald
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | signup_empty_form.patch | 990 bytes | dww |
Comments
Comment #1
dwwgroups.drupal.org does a hack to get around the problem:
They never hit the error since only logged in users have signup perms on the site.
However, this is a hack to work-around a bug. It's a problem that signup.module assumes you have fields there. Here's an initial patch to fix the underlying bug. Give it a try.
The patch should also modify the comments in the default theme_signup_user_form() function, to say it's ok to replace the whole function with a theme function that just does "return array()" in cases where you don't want any extra fields at all, and to clarify you only need the #tree stuff if you define fields. But, first, please give this a try and see if it solves the problem for you.
Cheers,
-Derek
Comment #2
dwwOh yeah, the patch... ;)
Comment #3
rokrHi Derek,
the patch works for me as expected. Thanks for the fast answer!
I hope this goes into the next realease for easy updating. :-)
cheers, Ronald
Comment #4
dwwCommitted to HEAD and DRUPAL-5. This will be out in 5.x-2.5 and 5.x-1.1 whenever I release those, and in the -dev snapshots in about 5 hours. ;)
Comment #5
socialnicheguru commentedsubscribing...
i wanted to have my logged in users be able to just hit Signup and be signed up for the event without having to be taken to a different page.
How would I accomplish that?
Chris
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
vardhand commentedI want to remove the existing default signup fields and add new fields that will show up on the signup form. I did what the instructions in the INSTALL.txt said, but the new fields do not show up. What am I missing? Any help would be appreciated.
Here is what I added to the the template.php in the salmanaderskins folder.
/* Signup form override */
function salmanderksins_signup_user_form($node) {
global $user;
$form = array();
// If this function is providing any extra fields at all, the following
// line is required for form form to work -- DO NOT EDIT OR REMOVE.
$form['signup_form_data']['#tree'] = TRUE;
$form['signup_form_data']['AttendeeCount'] = array(
'#type' => 'textfield',
'#title' => t('Attendee Count'),
'#size' => 40, '#maxlength' => 64,
);
// If the user is logged in, fill in their name by default.
if ($user->uid) {
$form['signup_form_data']['Name']['#default_value'] = $user->name;
}
return $form;
}
Comment #8
Tino commented@vardhand, I just posted the same problem for 6.x-1.x-dev when I saw yours. Have you been able to figure this out?
edit: Fixed. Clear cache on the performance page...