Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter lewiskerns

    (@lewiskerns)

    Peter, My site has a front end page for users (subscribers) to update their preferences (it is not the wordpress profile page). I inserted the shortcode on this page so my users could set up 2FA on their own. Whenever a user visits this page, I receive an email from wordpress indicating a 404 error with the URL above. The page and 2FA functions appear to work correctly and users are able to configure their 2FA. So this is mostly an annoyance for me.

    I had the same problem and I think I resolved it with a few coding changes. I’m using
    – WordPress version 3.5.1
    – MySql 5.1.68
    – and Surveys version 1.01.8

    I found two problems.

    First, the new survey was not being saved in the database, but the questions were. That’s why the [surveys 0] worked. To fix this, I made a change in the file surveys/survey_action.php to the line that inserts a new row in the table. The field “final_screen” was not being set and MySql was complaining that there was no default value for it. The corrected line looks like:

    $wpdb->get_results(“INSERT INTO {$wpdb->prefix}surveys_survey(name,description,status,added_on,final_screen) VALUES(‘$_REQUEST[name]’,’$_REQUEST[description]’,’$_REQUEST[status]’,NOW(),”)”);

    This saved the row in the table, but it still would not display on the manage surveys screen. I found that MySql did not like the single quotes around the table name in the select statement in file surveys/survey.php

    So I removed the single quotes from around the table name. The corrected line looks like:

    $all_survey = $wpdb->get_results(“SELECT S.ID,S.name,S.added_on FROM {$wpdb->prefix}surveys_survey AS S “);

    With these two changes, I am now able to create new surveys and manage them.

    Hope this helps.

Viewing 2 replies - 1 through 2 (of 2 total)