Module

Developer
Supported

EE 1
EE 2
ProForm Drag and Drop Form Builder

Back to this add-on's main page
View Other Add-ons From Isaac Raway

     

You must be logged in to post.

[Resolved] Mailing List ID bug

Bug Report

dev@conflare.com
dev@conflare.com

ProForm Version: 0.42.1 BETA
EE Version: 2.3.1

Problem: Adding mailing list subscription fields to form doesn’t reliably set the correct mailing list ID value (corresponding to exp_mailing_lists list_id field).

To reproduce:

1. Create 2 or more mailing lists.
2. Delete the first list created.
3. Create a new Mailing List Subscription field, tying it to the second list you created (now the first appearing in the drop down).
3a. You can see in the drop down in Web Inspector/Firebug/equivalent or View Source that the value for that list is 1, even though it should be 2 (or greater, depending on work flow up to this point) in exp_mailing_lists list_id.
4. You will see in exp_proform_fields that mailinglist_id is stored as 1, which is incorrect.

Fix:

In mcp.proform.php in the method edit_field, change the line (964):

$mailinglists array_merge(array(=> 'None'), $mailinglists); 

to:

$mailinglists = array(=> 'None') + $mailinglists

array_merge doesn’t preserve numeric keys, but the plus array operator does.

dev@conflare.com
# 1
dev@conflare.com

FYI, I’m seeing other uses of array_merge that seem like they would cause similar issues for other fields. You may want to go through the whole add-on and review those.

MetaSushi
# 2
Developer
MetaSushi

Most of these have been fixed in the RC that I’m testing right now, I will make sure to look back through and check all of the usages. We caught it a bit too late to make it into the final beta release, but it will definitely be fixed in 1.0.