WordPress.org

Ready to get started?Download WordPress

Forums

SpeakUp! Email Petitions
[resolved] Problem creating or updating a petition (12 posts)

  1. HumbleScholar
    Member
    Posted 2 years ago #

    I have a clean installation of the WP 3.3.1 and Suffusion theme. The only other installed plugin is CataBlog.
    Unable to create new petitions - they are not saved in the db. Accidentally managed to save on an n-th attempt but then could not udate the petition.
    When attemting to create or update I'm getting two warnings:
    One on the top of the page with following message: Warning: unserialize() expects parameter 1 to be string, array given in /home/cybecom/cybe.com/wp-content/plugins/speakup-email-petitions/includes/admin-edit.php on line 134
    And the second warning is displayed within the Display Settings box above each address field: Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/cybecom/cybe.com/wp-content/plugins/speakup-email-petitions/includes/admin-edit-view.php on line 96
    Please help!

    http://wordpress.org/extend/plugins/speakup-email-petitions/

  2. Kreg Wallace
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for finding a bug I overlooked. I just posted a new update to the plugin (version 1.6.2). Hopefully upgrading to the new version will fix the problem for you.

  3. HumbleScholar
    Member
    Posted 2 years ago #

    I very much appreciate the prompt response and the attempt to help - thank you!
    I'm afraid the patch did not work...
    I've upgraded to 1.6.2 and tried to update an existing petition to test.
    I've checked the Display Address Fields/Country and clicked save. It came up as updated successfully with no error messages showing but when I tested it it didn't actually save the new settings.
    Next I checked the SetExpiration Date. Set it a week ahead and clicked save. At that point both warnings from the original post came up again and no settings were updated.
    I'm only using one petition and I make do with direct database modifications of settings but this is really weird behavior...
    If you like I can post all the details of my host php mysql versions etc. if it helps you debug.

  4. Kreg Wallace
    Member
    Plugin Author

    Posted 2 years ago #

    There's a new update (now version 1.7) that hopefully will fix this. Sorry for the troubles so far.

    I don't think the issue has anything to do with MySQL or PHP versions. It's just a matter of ensuring that the value in the address_fields database column is always the same data type (serialized array).

  5. HumbleScholar
    Member
    Posted 2 years ago #

    Hi Kreg,
    I'm afraid this patch screwed things up even more...
    Now the
    "Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/cybecom/cybe.com/wp-content/plugins/speakup-email-petitions/includes/public.php on line ..."
    messages for each address line appear not only in the admin section but also in the widgets, which now makes it totally unusable..
    Please have a look at http://www.cybe.com you can use admin admin to test.
    Thanks for your help.

  6. Kreg Wallace
    Member
    Plugin Author

    Posted 2 years ago #

    HumbleScholar,

    I just tried logging in as suggested and was able to create and edit petitions without any problems or error messages.

    I did notice all the error messages on the petition you created earlier. You said that you were manually editing the database fields to get your petition working. This is probably what's causing the current problem. If you manually set the address_fields column to blank or to anything other than a serialized array (will look like gibberish in database view), you will get these errors.

    My suggestion is to create your petition again from scratch using the provided UI and things should work fine. You can just delete your old copy of the petition (as well as the two test petitions I made).

  7. HumbleScholar
    Member
    Posted 2 years ago #

    I hate to bother you again but the problems are still there..
    I deleted the petition that was created manually, as you suggested and tried to re-create it through the interface.
    It gave me absolute hell starting from not saving it [emailpetition id="0"] and then when I tried to update some of the settings it came up with an empty page asking "Are you sure you want to do that"...
    Eventually I managed to re-create the petition by adding things one at a time and updating. That kinda worked in the admin area and on the petition page but the widget is still coming up with the warnings - just have a look at the sidebar. It does that even with your test petitions 3 and 4...
    May I suggest when you create a test petition, fill out all the fields on the form - that might bring up the bug.
    Many thanks for your kind help!

  8. Kreg Wallace
    Member
    Plugin Author

    Posted 2 years ago #

    Ok, I re-installed the plugin on your site and then re-created the petition as you had it before. Then I added it as a widget.

    I was able to successfully sign the petition, receive the confirmation mail, and confirm my signature. This all seemed to go well on the first try. Maybe a re-install was all it needed. (Feel free to delete my signature if you like).

    After making the petition, I realized I had forgotten to check if you had made modifications to the settings page. Sorry about that. Any custom settings you made are gone now. You should visit the Settings page to make sure things are set the way you want. I doubt the settings page stuff would effect the errors you saw before, but let me know if they crop up again.

  9. HumbleScholar
    Member
    Posted 2 years ago #

    Thanks very much for helping, Kreg. There's one more thing I noticed: I was trying to update the petition you created and the 'Petition updated' message was comming up but the changes were not saved. I later traced it to a single quote within the twitter message "I've". As soon as I changed it to 'I have' it saved everything just fine.

  10. Kreg Wallace
    Member
    Plugin Author

    Posted 2 years ago #

    Good catch! I must have the input restrictions on that field set a little too tight. I'll try to fix it for the next update.

  11. somethingelse
    Member
    Posted 2 years ago #

    just in case anyone else goes thru the experience that i just did, i thought i'd share.

    i've just taken over the maintenance of a site - had to upgrade the WP from 3.1 to 3.3.1... did the usual steps, backed up, deactivated plugins etc etc...
    upgrade went fine, was previously using v 1.5.2 of this plugin... so updated to latest (1.7.1)... got the "Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/cybecom/cybe.com/wp-content/plugins/speakup-email-petitions/includes/public.php on line ..." errors...

    panicked for a minute, afraid that was way over my head.

    read the notes above...
    decided to start by simply going to the existing petition i had and clicked the UPDATE PETITION button...
    PROBLEM SOLVED.

    I was a bit apprehensive to remove the petition & start over, as I mentioned, this is a new client and didn't want to risk losing their data or messing something up.

    was VERY relieved when a simple :update' button fixed my trouble.

    wicked plugin, btw - thanks so much!

  12. Kreg Wallace
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for posting this, @somethingelse. I thought I had that issue fully resolved in 1.7.1. Glad you were able to find a simple solution.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic