• Resolved Digma

    (@digma)


    WP-members version: 2.8.1 (patched for pre PHP 5.3)

    I intended to add a dropdown field for my profiles page and it stores all the information just fine apart from the:

    “For dropdown, array of values:”

    From my point of view I entered it correctly:
    Please select|,
    Option number 1|1,
    Option number 2|2,
    Option number 3|3

    Also tried it without the “Please select|,”

    But for some reason it won’t store the information for that field.

    It’s probably something stupid simple, but I haven’t been able to find what is causing this, let alone solve it.

    Any idea on what is going on and how to make it store the information?

    Thanks in advance.

    EDIT:
    when opening the ‘edit profile’ page. I see the following line above the field I added:

    Warning: Invalid argument supplied for foreach() in /home/public_html/wp_test/wp-content/plugins/wp-members/wp-members-core.php on line 812

Viewing 9 replies - 1 through 9 (of 9 total)
  • im having a similar issue but instead i keep getting fatal error
    “Fatal error: Call to undefined function str_getcsv() in /home/skim89/public_html/wp-content/plugins/wp-members/admin/tab-fields.php on line 206”

    line 206 – $arr[7] = str_getcsv( $str, ‘,’, ‘”‘ );

    what does your 206 line say or do u have any idea why its doing this?

    lol now im having the same exact problem as you

    line 812 – foreach( $value as $option ) {

    i actually think i fixed it. idk if i really did but the error dont show up on my site anymore. the only problem is that the dropdown menu on my site still doesnt show. its just an empty small box with no selections.

    line 812 – foreach( $value as $option ) {

    replace it with

    line 812 – foreach( (array) $value as $option ) {

    Thread Starter Digma

    (@digma)

    Thread Starter Digma

    (@digma)

    Before the wrong idea is being raised here. The patch did not solve the initial problem of the dropdown array not saving.

    Plugin Author Chad Butler

    (@cbutlerjr)

    As an update to this, I did some further work with some premium support clients that were experiencing issues and I have changed the patch.

    At this time, it is just not going to work to try to retro-fit str_getcsv into PHP 5.2 installs. Yes that is my fault for changing the process to incorporate str_getcsv in the first place – this was a case of putting your finger in the dike to plugin one hole, but the water will find some other place to leak out as a result.

    The reason for the change was to more easily allow commas into the dropdown values. But this leaves out users of PHP 5.2 and the current WP requirements are PHP 5.2.4.

    So… I’ve been searching for a solution that will parse the string into an array appropriately for the 5.2 users. But that has yet to meet with success. So I’ve updated to the patch to simply roll back to the way that the plugin operated before.

    See: http://rocketgeek.com/blog/wp-members-2-8-1-str_getcsv-patch-for-php-5-3/ for the updated version.

    As I mentioned, this eliminates str_getcsv altogether, so for those users, the dropdown will be what it used to be – no commas in the dropdown values.

    The 2.8.2 update for the plugin will look at the user’s PHP version and adjust accordingly – that way, we can use str_getcsv in 5.3+ installs and still function in 5.2 without errors.

    I will continue searching for a solution that will provide the same functionality for PHP 5.2 users, but that may not make it into the 2.8.2 release.

    okay thank you so much!

    Thread Starter Digma

    (@digma)

    Many thanks for supplying this solution. It solved both problems together.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Dropdown array won't save’ is closed to new replies.