Okay
  Public Ticket #1112947
Placeholder has Default Value
Closed

Comments

  •  2
    xtzman started the conversation

    I´m using this shortcode with var1

    [wpdatatable id=107 var1='2']

    I´m using %VAR1% placeholder has the "default value" of field : "idcoisa"

    When i have the editor type has: "one-line-edit" everything works fine...
    the number "2" apears on the editor.

    But...

    When i have the editor type has: "none", and create a +new registry, it just saves the "%VAR1%" and not the number 2.

    Is there a way to fixe that?



  • [deleted] replied

    Hi xtzman,
    Thank you for the purchase.

    Please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here just check PRIVATE so nobody can see it except us.


  •   xtzman replied privately
  • [deleted] replied

    Hi xtzman,

    It is fixed. I have replaced code on your website. If you have this bug in one of the future releases, please find in file ../wp-content/plugins/wpdatatables/controllers/wdt_ajax_actions.php this lines:

    // For new values we take the default value (if defined)
    if( !empty( $column->default_value ) ){
        $formdata[$column->orig_header] = $column->default_value;
    }else{
        unset($formdata[$column->orig_header]);
    }
    

    and replace them with:

    // For new values we take the default value (if defined)
    if (in_array($column->default_value, ['%VAR1%', '%VAR2%', '%VAR3%']) == false) {
        if (!empty($column->default_value)) {
            $formdata[$column->orig_header] = $column->default_value;
        } else {
            unset($formdata[$column->orig_header]);
        }
    }
    

    But we will see to include this fix in the next update.