WordPress.org

Ready to get started?Download WordPress

Forums

Campaign Monitor Synchronization (moved)
[resolved] Multi Select & Checkbox custom fields (5 posts)

  1. desmillicious
    Member
    Posted 8 months ago #

    Hello I have used Advanced Custom Fields to create a multi-select key value pair custom fields for my user profile.

    When I choose this field to be synched with my list in the Campaign Monitor Synchronisation settings page, I get the following error:

    Campaign Monitor synchronization error.
    Failed to deserialize your request. Please check the documentation and try again.Fields in error: subscriber

    I believe this is to do with the format data stored in the custom field in the wp usermeta table. Specifically, the multi-select value is stored as follows (this is with only one value selected)
    a:1:{i:0;s:17:"access_to_justice";}

    Is it possible to send multiple values to Campaign Monitor list via your plugin?
    If so what format should the custom field store its data, and are there any recommended methods for creating this custom field so that the value store is formatted correctly?

    http://wordpress.org/plugins/campaign-monitor-synchronisation/

  2. Carlo Roosen
    Member
    Plugin Contributor

    Posted 8 months ago #

    Thanks for your feedback!

    Our plugin uses this WP function to get the metadata:

    `get_user_meta( $user->ID, $field, $single )

    Currently we use $single = true, which means we only read one value. We will change the plugin so it uses $single = false, the function will then return an array, and we will loop through the array and store the multiple values.

    Also we will take care that a value like a:1:{i:0;s:17:"access_to_justice";} will be stored as text, so at least it does not generate an error.

    However, this probably does not solve your problem immediately, because get_user_meta( , , false) searches the database for multiple rows with the same user/field combination, and not as a serilized array as seems to be the case with 'Advanced Custom Fields'.

    So I suggest you upgrade our plugin once we are done, and then find a way to store the field in the native WordPress way. Maybe the authors of 'Advanced Custom Fields' can help you on this part of the problem.

    Regards, Carlo

  3. Carlo Roosen
    Member
    Plugin Contributor

    Posted 8 months ago #

    Hi,

    We decided not to implement multiple fields right now. The problem we ran into is that Campaign Monitor needs to know beforehand if a filed can contain multiple values. We can solve this, but then we need extra options in the plugin. And we want to keep it simple if possible.

    If anyone reading this needs multiple fields, let us know, we might reconsider this decision when many people need it.

    Regards, Carlo

  4. cmsme
    Member
    Posted 5 months ago #

    Hi there

    just chiming in with a +1 for this... I have a current need for multi-select fields. similar to @desmillicious i am using the Advanced Custom Fields plugin to create user fields.

    thanks!

  5. Carlo Roosen
    Member
    Plugin Contributor

    Posted 5 months ago #

    Anyone else using Advanced Custom Fields to create multiple value fields?

    We could build an automatic detection for exact this use case. The interface would remain the same and it would work out of the box. But, it would only work for fields created with Advanced Custom Fields.

    Your votes please !

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.