• Resolved ftruong

    (@ftruong)


    Hey so I’m testing out the plugin with a form that has a bunch of “if this, show this” options, and I’m encountering this error:

    Warning: str_replace() expects at least 3 parameters, 2 given in /…/public_html/wordpress/wp-content/plugins/gravity-forms-wcag-20-form-fields/gravity_forms_wcag20_form_fields_plugin.php on line 179

    I checked the line and the bit of code that it’s referring to is this:

    $content = str_replace("<label class='gfield_label' >".$field_label."<label class='gfield_label' for='input_".$form_id."_".$field_id."' >".$field_label." <span id='field_".$form_id."_".$field_id."_dmessage' class='sr-only'> - " . sprintf( __( 'must be %s format', 'gfwcag' ), $date_format ) . "</span>",$content );

    Any fixes?

    https://www.ads-software.com/plugins/gravity-forms-wcag-20-form-fields/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ovann86

    (@ovann86)

    Hey,

    It looks like it’s missing a comma – there’s a dot there instead by mistake.

    Could you try

    $content = str_replace("<label class='gfield_label' >".$field_label,"<label class='gfield_label' for='input_".$form_id."_".$field_id."' >".$field_label." <span id='field_".$form_id."_".$field_id."_dmessage' class='sr-only'> - " . sprintf( __( 'must be %s format', 'gfwcag' ), $date_format ) . "</span>",$content );

    Note that comma after the first $field_label

    Failing that, if you can export the form and email it through to [email protected] I’ll take a look at what’s going wrong.

    Thread Starter ftruong

    (@ftruong)

    Thanks! That fixes it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bug related to dates?’ is closed to new replies.