• Resolved alexio101

    (@alexio101)


    Hi,

    After the latest contactfrom7 update, there is a message to validate the forms.

    When i do that, there is a fatal error with the message below

    Λεπτομ?ρειε? σφ?λματο?

    ===========================================

    ?να σφ?λμα τ?που E_ERROR εντοπ?στηκε στη γραμμ? 185 του αρχε?ου/wp-content/plugins/contact-form-7-dynamic-text-extension/includes/validation.php. Κωδικ?? σφ?λματο?: Uncaught TypeError: Cannot access offset of type string on string in /wp-content/plugins/contact-form-7-dynamic-text-extension/includes/validation.php:185

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Tessa (they/them), AuRise Creative

    (@tessawatkinsllc)

    Thanks for reporting this, I’ll look into it!

    Plugin Author Tessa (they/them), AuRise Creative

    (@tessawatkinsllc)

    @alexio101 can you please confirm that you’re using version 5.8.1 of Contact Form 7 and version 4.1.0 of Contact Form 7 – Dynamic Text Extension, please? And also steps to reproduce your error exactly.

    I haven’t been able to reproduce your error yet, the line of code that is being flagged in your fatal error is this one:

    $raw_value = $contact_form->prop($components[0])[$components[1]];

    In my test case, the value of $components[0] is mail and the value of $components[1] is sender (because I’m using a DTX email field as my sending email address) so calling $contact_form->prop("mail") gets the mail property from the form object and then it retrieves the sender attribute. In my test case, $raw_value successfully retrieved the value I set as [_site_title] <[dtx_email]> as the sender my mail template.

    However, the error you posted is implying that the mail object is a string and therefore breaking when trying to get the sender property (the indexes in $components was already validated on line 179). I can add validation to ensure that the value of $contact_form->prop($components[0]) is an array type before I attempt to access the attribute, but it has me concerned that there’s something else broken in your instance because it just shouldn’t be a string.

    I can see in CF7’s release notes for 5.8.1 that there are changes to the configuration validator and they note that some are backward-incompatible so that could be the issue as well.

    I’ll keep looking.

    Plugin Author Tessa (they/them), AuRise Creative

    (@tessawatkinsllc)

    I haven’t been able to reproduce your error. Are you still having this issue?

    Thread Starter alexio101

    (@alexio101)

    Hi,

    Since the problem was in validation while your plugin was active, i disabled temporarily, did the form validation, re-enabled it and everything works great.
    Thank you for looking into it.

    Plugin Author Tessa (they/them), AuRise Creative

    (@tessawatkinsllc)

    Oh good! Must’ve been a strange glitch in your instance. A good ‘ole turn it off and back on again did the trick. ??

    Thread Starter alexio101

    (@alexio101)

    Exactly ??
    That made my day, thank you for the good energy! :))

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Fatal error on form validation’ is closed to new replies.