Support » Plugin: WP Idea Stream » Error message: “Something went wrong while trying to save your idea”

  • Hello guys!

    No matter what I do, I keep receiving an error message after trying to add a idea: “Something went wrong while trying to save your idea”.

    I disabled the plugins, the themes, and nothing solved the problem. I even tried to set the WordPress WP_DEBUG to true, but nothing about any error was printed.

    Any ideas?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mathieu Viet

    (@imath)

    Hi,

    Could you describe a little more your configuration and what you are doing ?

    – PHP version ?
    – is it a new install of WP Idea Stream, or is this happening once you’ve upgraded the plugin to 2.4.0 ?
    – Are you using a multisite or a regular configuration ?
    – is BuddyPress activated ? If so what is the version ?
    – Are you adding images to your idea, are you using the checkbox to use one of the image as a featured image ?
    – Have you tried to add an idea from the Administration screen ?
    – is there anything related to WP Idea Stream inside the error.log of your server ?

    If you add this code inside the functions.php of your theme, what is the output ?

    function diegobrrspf_before_save( $posted_vars ) {
       var_dump( $posted_vars );
       die();
    }
    add_action( 'wp_idea_stream_ideas_before_idea_save', 'diegobrrspf_before_save', 10, 1 );

    After removing the previous code, if you add this code inside the functions.php of your theme, what is the output ?

    function diegobrrspf_before_save( $idea_id ) {
       var_dump( $idea_id );
       die();
    }
    add_action( 'wp_idea_stream_after_save', 'diegobrrspf_after_save', 10, 1 );

    Once done don’t forget to remove this code.

    • This reply was modified 3 years, 8 months ago by Mathieu Viet.
    • This reply was modified 3 years, 8 months ago by Mathieu Viet.

    Hi,
    I have same problem. my error message:”An error occurred. Please try again.”
    But The Idea is added successfully on db, but error message appears!
    php version: 5.6
    it happens when i upgrade wp to 4.7.3.
    regular configuration
    BuddyPress is activated. 2.8.2
    Image=>yes,checkbox=>yes.
    add an idea from the Administration screen=>yes and it’s done.
    add an idea from the Front End=>yes and it’s done,but error message appears!
    error_log=> no
    code 1: nothing(no change)!
    code 2: nothing(no change)!

    bytheway i hace replaced this code instead of (wp-idea-stream/templates/idea-form.php).
    (because i need multi-step ajax form and extra fields ;D)

    <?php
    acf_enqueue_uploader();
    
    global $userdata;
    $asset = plugin_dir_url(__FILE__) . "neon/";
    $form_action = get_bloginfo('template_url', 'display') . "/idea_submit.php";
    ?>
    <link rel="stylesheet" href="<?= $asset ?>assets/css/style.css">
    <link rel="stylesheet" href="<?= $asset ?>assets/css/neon-forms.css">
    <script src="<?= $asset ?>assets/js/gsap/main-gsap.js"></script>
    <script src="<?= $asset ?>assets/js/joinable.js"></script>
    <script src="<?= $asset ?>assets/js/resizeable.js"></script>
    <script src="<?= $asset ?>assets/js/neon-api.js"></script>
    <script src="<?= $asset ?>assets/js/jquery.bootstrap.wizard.min.js"></script>
    <script src="<?= $asset ?>assets/js/jquery.validate.min.js"></script>
    <script src="<?= $asset ?>assets/js/neon-custom.js"></script>
    <script src="<?= get_bloginfo('template_url', 'display') ?>/assets/js/jquery.livequery.js"></script>
    
    <script type="text/javascript">
        var waitingDialog = waitingDialog || (function ($) {
                'use strict';
    
                // Creating modal dialog's DOM
                var $dialog = $(
                    '<div class="modal fade" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-hidden="true" style="padding-top:15%; overflow-y:visible;">' +
                    '<div class="modal-dialog modal-m">' +
                    '<div class="modal-content">' +
                    '<div class="modal-header"><h3 style="margin:0;"></h3></div>' +
                    '<div class="modal-body">' +
                    '<div class="progress progress-striped active" style="margin-bottom:0;"><div class="progress-bar" style="width: 100%"></div></div>' +
                    '</div>' +
                    '</div></div></div>');
    
                return {
                    /**
                     * Opens our dialog
                     * @param message Custom message
                     * @param options Custom options:
                     *                  options.dialogSize - bootstrap postfix for dialog size, e.g. "sm", "m";
                     *                  options.progressType - bootstrap postfix for progress bar type, e.g. "success", "warning".
                     */
                    show: function (message, options) {
                        // Assigning defaults
                        if (typeof options === 'undefined') {
                            options = {};
                        }
                        if (typeof message === 'undefined') {
                            message = 'Loading';
                        }
                        var settings = $.extend({
                            dialogSize: 'm',
                            progressType: '',
                            onHide: null // This callback runs after the dialog was hidden
                        }, options);
    
                        // Configuring dialog
                        $dialog.find('.modal-dialog').attr('class', 'modal-dialog').addClass('modal-' + settings.dialogSize);
                        $dialog.find('.progress-bar').attr('class', 'progress-bar progress-bar-orange');
                        if (settings.progressType) {
                            $dialog.find('.progress-bar').addClass('progress-bar-' + settings.progressType);
                        }
                        $dialog.find('h3').text(message);
                        // Adding callbacks
                        if (typeof settings.onHide === 'function') {
                            $dialog.off('hidden.bs.modal').on('hidden.bs.modal', function (e) {
                                settings.onHide.call($dialog);
                            });
                        }
                        // Opening dialog
                        $dialog.modal();
                    },
                    /**
                     * Closes dialog
                     */
                    hide: function () {
                        $dialog.modal('hide');
                    }
                };
    
            })(jQuery);
    
        (function ($) {
            // setup fields
            acf.do_action('append', $('#popup-id'));
            acf.o = {};
            acf.screen = {};
            acf.o.post_id = 0;
            acf.screen.post_id = 0;
    
            $("[data-hide]").livequery(function () {
                $(this).on("click", function () {
                    $(this).closest("." + $(this).attr("data-hide")).fadeOut();
                    return false;
                });
            });
    
            $("#acf-field_55f47fc3bd185").livequery(function () {
                $(this).val("<?= $userdata->display_name ?>")
            });
    
            $("#rootwizard-2").livequery(function () {
                $(this).submit(function () {
                    var form = $(this);
                    if (!form.valid()) return false;
                    var files = $("#idea_attachment").prop('files');
                    var formData = new FormData(document.getElementById("rootwizard-2"));
                    $("#idea_form_alert").slideUp();
                    if ($('#idea_attachment').val().length > 0) {
                        for (var x in files) {
                            var filesize = ((files[x].size / 1024) / 1024).toFixed(4); // MB
                            if (filesize > 25) {
                                $("#idea_form_alert i").removeClass("icon-ok-circled").addClass("icon-cancel-circled");
                                $("#idea_form_alert span").html("Limit:25MB");
                                $("#idea_form_alert").removeClass("alert-success").addClass("alert-danger").slideDown();
                                return false;
                            }
                            if (files[x].name != "item" && typeof files[x].name != "undefined") {
                                formData.append('file[' + x + ']', files[x]);
                            }
                        }
                    }
                    waitingDialog.show("Proccessing ...");
                    $('body').css({'cursor' : 'wait'});
                    formData.append('action', 'sbm_idea');
                    $.ajax({
                        url: ajaxurl,
                        type: 'POST',
                        data: formData,
                        cache: false,
                        contentType: false,
                        processData: false,
                        async: false
                    }).complete(function (res) {
                        if(res.readyState == 4){
                            $("#tab2-1").tab('show');
                            try {
                                res = JSON.parse(res.responseText);
                            } catch (e) {
                                res = {
                                    success: false, message: "An error occurred. Please try again."
                                };
                            }
                            if (res.success) {
                                $("#idea_form_alert i").removeClass("icon-cancel-circled").addClass("icon-ok-circled");
                                $("#idea_form_alert span").html("Your Idea added successfully.");
                                $("#idea_form_alert").removeClass("alert-danger").addClass("alert-success").slideDown();
                                $("#rootwizard-2")[0].reset();
                                $("#acf-field_55f47fc3bd185").val("<?= $userdata->display_name ?>");
                            } else {
                                $("#idea_form_alert i").removeClass("icon-ok-circled").addClass("icon-cancel-circled");
                                $("#idea_form_alert span").html(res.message);
                                $("#idea_form_alert").removeClass("alert-success").addClass("alert-danger").slideDown();
                            }
                            waitingDialog.hide();
                            $('html, body').animate({scrollTop: 0}, 'slow');
                        }
                        $('body').css({'cursor' : 'default'});
                    }).fail(function () {
                        $("#idea_form_alert i").removeClass("icon-ok-circled").addClass("icon-cancel-circled");
                        $("#idea_form_alert span").html("An error occurred. Please try again.");
                        $("#idea_form_alert").removeClass("alert-success").addClass("alert-danger").slideDown();
                        waitingDialog.hide();
                        $('body').css({'cursor' : 'default'});
                    });
                    return false;
                });
            });
            $("#idea_title").livequery(function () {
                $(this).on("change", function () {
                    $('#ideaTitle b').html($(this).val());
                });
            });
            $("#acf-field_55f48102bd186").livequery(function () {
                $(this).on("change", function () {
                    $('#ideaSummary').html($(this).val().replace(/\r\n|\r|\n/g, "<br />"));
                });
            });
        })(jQuery);
    </script>
    <div class="row">
        <div class="col-lg-12">
            <? if (is_user_logged_in()) { ?>
                <section class="panel">
                    <header class="panel-heading">
                        Idea Form
                    </header>
                    <div class="panel-body">
                        <form id="rootwizard-2" class="form-wizard validate" enctype="multipart/form-data"
                              onsubmit="return false;">
    
                            <div class="steps-progress">
                                <div class="progress-indicator"></div>
                            </div>
    
                            <ul>
                                <li class="active">
                                    <a href="#tab2-1" data-toggle="tab"><span>1</span>summary</a>
                                </li>
                                <li>
                                    <a href="#tab2-2" data-toggle="tab"><span>2</span>attachment</a>
                                </li>
                                <li>
                                    <a href="#tab2-3" data-toggle="tab"><span>3</span>category</a>
                                </li>
                                <li>
                                    <a href="#tab2-4" data-toggle="tab"><span>4</span>description</a>
                                </li>
                                <li>
                                    <a href="#tab2-5" data-toggle="tab"><span>5</span>accept</a>
                                </li>
                            </ul>
    
                            <div class="tab-content">
                                <div id="idea_form_alert" class="alert alert-success" style="display: none">
                                    <a href="#" class="close" data-hide="alert" aria-label="close">&times;</a>
                                    <strong><i class="icon-ok-circled"></i></strong> <span>Success.</span>
                                </div>
                                <div class="tab-pane active" id="tab2-1">
                                    <div class="row"></div>
                                    <div class="row">
    
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <div class="acf-fields acf-form-fields">
                                                    <div class="acf-field acf-field-text" data-type="text">
                                                        <div class="acf-label">
                                                            <label for="idea_title">Title</label>
                                                        </div>
                                                        <div class="acf-input">
                                                            <div class="acf-input-wrap"><input type="text" id="idea_title"
                                                                                               data-validate="required"
                                                                                               name="acf[idea_title]"
                                                                                               placeholder="Your Idea Title">
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
    
                                    </div>
    
                                    <div class="row">
    
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <?php acf_form(array(
                                                    'post_id' => 'new_post',
                                                    'field_groups' => array(7290),
                                                    'fields' => array('field_55f48102bd186'),
                                                    'form' => false,
                                                )); ?>
                                            </div>
                                        </div>
    
                                    </div>
    
                                    <div class="row">
    
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <?php acf_form(array(
                                                    'post_id' => 'new_post',
                                                    'field_groups' => array(7290),
                                                    'fields' => array('field_55f47fc3bd185'),
                                                    'form' => false,
                                                )); ?>
                                            </div>
                                        </div>
    
                                    </div>
    
                                </div>
    
                                <div class="tab-pane" id="tab2-2">
    
                                    <div class="row">
    
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <input id="idea_attachment" type="file" class="form-control"
                                                       name="acf[idea_attachment]" multiple>
                                            </div>
                                        </div>
    
                                    </div>
    
                                </div>
    
                                <div class="tab-pane" id="tab2-3">
    
                                    <div class="row">
    
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <?php acf_form(array(
                                                    'post_id' => 'new_post',
                                                    'field_groups' => array(7290),
                                                    'fields' => array('field_55f4816abd187'),
                                                    'form' => false,
                                                )); ?>
                                            </div>
                                        </div>
    
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <?php acf_form(array(
                                                    'post_id' => 'new_post',
                                                    'field_groups' => array(7290),
                                                    'fields' => array('field_55f48202bd188'),
                                                    'form' => false,
                                                )); ?>
                                                <div class="hide">
                                                    <?php acf_form(array(
                                                        'post_id' => 'new_post',
                                                        'field_groups' => array(7290),
                                                        'fields' => array('field_55f48320bd189'),
                                                        'form' => false,
                                                    )); ?>
                                                </div>
                                            </div>
                                        </div>
    
                                    </div>
    
                                    <div class="row">
    
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <?php acf_form(array(
                                                    'post_id' => 'new_post',
                                                    'field_groups' => array(7290),
                                                    'fields' => array('field_55f483a3bd18e'),
                                                    'form' => false,
                                                )); ?>
                                            </div>
                                        </div>
    
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <?php acf_form(array(
                                                    'post_id' => 'new_post',
                                                    'field_groups' => array(7290),
                                                    'fields' => array('field_55f483ecbd18f'),
                                                    'form' => false,
                                                )); ?>
                                            </div>
                                        </div>
    
                                    </div>
    
                                </div>
    
                                <div class="tab-pane" id="tab2-4">
                                    <div class="row">
    
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <div class="acf-field acf-field-textarea">
                                                    <div class="acf-label">
                                                        <label for="_the_content">description</label>
                                                    </div>
                                                    <div class="acf-input">
                                                        <textarea id="idea_full_content" name="acf[idea_full_content]"
                                                                  placeholder="" rows="8"></textarea>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
    
                                    </div>
    
                                    <div class="row">
    
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <?php acf_form(array(
                                                    'post_id' => 'new_post',
                                                    'field_groups' => array(7290),
                                                    'fields' => array('field_55f484a4bd191'),
                                                    'form' => false,
                                                )); ?>
                                            </div>
                                        </div>
    
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <?php acf_form(array(
                                                    'post_id' => 'new_post',
                                                    'field_groups' => array(7290),
                                                    'fields' => array('field_55f484c7bd192'),
                                                    'form' => false,
                                                )); ?>
                                                <?php acf_form(array(
                                                    'post_id' => 'new_post',
                                                    'field_groups' => array(7290),
                                                    'fields' => array('field_55f4847bbd190'),
                                                    'form' => false,
                                                )); ?>
                                            </div>
                                        </div>
    
                                    </div>
    
                                </div>
    
                                <div class="tab-pane" id="tab2-5">
    
                                    <div class="form-group" style="
    							border: 1px solid #d3d3d3;
    							border-radius: 3px;
    							padding: 5px 10px 0;">
                                        <p id="ideaTitle"><b></b></p>
                                        <p id="ideaSummary"></p>
                                    </div>
    
                                    <div class="form-group">
                                        <div class="checkbox checkbox-replace">
                                            <input type="checkbox" name="chk-rules" id="chk-rules" data-validate="required"
                                                   data-message-message="Do you accept?" checked="checked">
                                            <label for="chk-rules"><b>I accept</b></label>
                                        </div>
                                    </div>
    
                                    <div class="form-group">
                                        <button type="submit" class="btn btn-primary">Finalize the idea.</button>
                                    </div>
    
                                </div>
    
                                <ul class="pager wizard">
                                    <li class="previous">
                                        <a href="#">« Return</a>
                                    </li>
    
                                    <li class="next">
                                        <a href="#">Continue »</a>
                                    </li>
    
                                    <li class="" style="float: left;margin-left: 5px;">
                                        <a href="javascript:;"
                                           onclick="jQuery('#rootwizard-2 button[type=submit]').click()">Final accept</a>
                                    </li>
                                </ul>
                            </div>
    
                        </form>
                    </div>
                </section>
            <? } else { ?>
                <section class="panel">
                    <header class="panel-heading">
                    </header>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-12">
                                Please Login..
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-12">
                                <? global $wp;
                                $current_url = home_url(add_query_arg(array(), $wp->request)); ?>
                                <a href="<?= wp_login_url($current_url) ?>">SignIn</a>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-12">
                                <a href="<?= wp_registration_url() ?>">Register</a>
                            </div>
                        </div>
                    </div>
                </section>
            <? } ?>
        </div>
    </div>
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error message: “Something went wrong while trying to save your idea”’ is closed to new replies.