This patch file includes kaushik_sarkar's 5.x update, as well as the following:

Have added fields to the Admin Settings function to allow for customizable text field name and descriptive text. Edited the code injection function to make use of these new variables.

One issue has come up, though:

* warning: Missing argument 2 for variable_get(), called in C:\xampp\xampp\htdocs\modules\regcode\regcode.module on line 138 and defined in C:\xampp\xampp\htdocs\includes\bootstrap.inc on line 369.
* warning: Missing argument 2 for variable_get(), called in C:\xampp\xampp\htdocs\modules\regcode\regcode.module on line 141 and defined in C:\xampp\xampp\htdocs\includes\bootstrap.inc on line 369.

Both of those calls seem to be correct, though:

case 'register':
// Inject the registration code field into the registration form.
$form['regcode_code'] = array(
'#type' => 'textfield',
'#title' => variable_get('regcode_title', ''),
//'#default_value' => variable_get('regcode_codes', ''),
'#required' => TRUE,
'#description' => variable_get('regcode_desc', '')
);
return $form;

Thanks for your attention to this. :)

Comments

jvermillion’s picture

Hrm, actually, this code is good to go. I had some outside sources test the page, and it seems like the errors I'm getting are just a cached copy of the old page.

colan’s picture

Title: Patched to 5.x and Added Feature » Customizable text field name and descriptive text
Status: Needs review » Needs work

Thanks for the patch. Would you be able to split it up though? As in, please post a patch exclusively for the new feature.

I'll create a separate issue for a 5.x version; I saw that post a while ago. Sorry about the delay.

jvermillion’s picture

Status: Needs work » Needs review
StatusFileSize
new1.56 KB

This is a patch for the 4.7.x code to add the requested features. I don't have any way to test 4.7.x code, so it will need to be reviewed.

jvermillion’s picture

StatusFileSize
new1.87 KB

Fixed a bug in the previous patch code that kept forcing regcode_title and regcode_desc back to their defaults.

colan’s picture

Version: 4.7.x-1.0 » 5.x-1.x-dev

Let's keep new features to the development branch of the 5.x version. I'm not planning on adding new features to the 4.7 version.

colan’s picture

Status: Needs review » Active
aidanlis’s picture

Status: Active » Closed (fixed)

Fixed in both the D5 and D6 release.