• I guess we will have to update to MailPoet 3 now, once we resolve a conflict with one other plugin (WP Cassify). Here is the error that MailPoet 2 generates with every page load that has the embedded MailPoet Subscription Form widget under PHP 7.3 and WordPress 5.2.

    Exception: Uncaught exception ‘Exception’ with message ‘Template ‘templates/form/web/widgets/#type.html’ not found !’ in wp-content/plugins/wysija-newsletters/helpers/render_engine.php:723

    Sample stack trace
    in WYSIJA_help_render_engine::_loadTemplate called at wp-content/plugins/wysija-newsletters/helpers/render_engine.php
    in WYSIJA_help_render_engine::_parse called at wp-content/plugins/wysija-newsletters/helpers/render_engine.php
    in WYSIJA_help_render_engine::render called at wp-content/plugins/wysija-newsletters/helpers/form_engine.php
    in WYSIJA_help_form_engine::render_web_body called at wp-content/plugins/wysija-newsletters/helpers/form_engine.php
    in WYSIJA_help_form_engine::render_web called at wp-content/plugins/wysija-newsletters/views/front/widget_nl.php
    in WYSIJA_view_front_widget_nl::display called at wp-content/plugins/wysija-newsletters/widgets/wysija_nl.php
    in WYSIJA_NL_Widget::widget called at wp-includes/class-wp-widget.php
    in WP_Widget::display_callback called at wp-includes/widgets.php
    in dynamic_sidebar called at wp-content/themes/modernize/footer.php
    in require_once called at wp-includes/template.php
    in load_template called at wp-includes/template.php
    in locate_template called at wp-includes/general-template.php
    in get_footer called at wp-content/themes/modernize/page.php
    in include called at wp-includes/template-loader.php
    in require_once called at wp-blog-header.php
    in require called at index.php

Viewing 6 replies - 1 through 6 (of 6 total)
  • Yes, this error only shows up when you include widget code on a given page. Didn’t think it was Mailpoet-2 at first as the plugin worked fine on another 7.3 site – but that site doesn’t display the subscribe widget.

    Did you happen to pinpoint the code problem? Not sure why it’s feeding it ‘#type.html’ as the file? :

    
            foreach($this->_template_path as $path) {
                if ($template && file_exists ("$path/$template")) {
                    $file = "$path/$template";
                    return $this->_loadFile ($file);
                }
            }
            throw new Exception ("Template '$template' not found !");
            return false;
    

    $template = “#type.html”?
    PHP Fatal error: Uncaught Exception: Template 'templates/form/web/widgets/#type.html' not found !
    Hmmm.

    I also get a compilation warning apparently before this error each time – not sure if related. Error on some PCRE here:

    if (preg_match ("'".self::_VAR.self::_MODIFIER."'", $value, $is_var)) {
    (^note – I replaced the 2 backtick characters with single-quotes as the forum editor switches code display on off.

    Log entry: “PHP Warning: preg_match(): Compilation failed: invalid range in character class at offset 11”

    • This reply was modified 5 years, 7 months ago by 22-7ths.
    • This reply was modified 5 years, 7 months ago by 22-7ths.
    • This reply was modified 5 years, 7 months ago by 22-7ths.
    • This reply was modified 5 years, 7 months ago by 22-7ths.
    • This reply was modified 5 years, 7 months ago by 22-7ths.
    • This reply was modified 5 years, 7 months ago by 22-7ths.
    • This reply was modified 5 years, 7 months ago by 22-7ths.

    Fixed/Solved entire problem – it was the preg_match as noted above:

    LINE 43: /wp-content/plugins/wysija-newsletters/helpers/render_engine.php

    Look for the “w-” (column 30)-
    Original code:
    const _VAR = '([\$#])([\w-_\.]+)';

    Add a back slash “\” before the “-”
    Updated code:
    const _VAR = '([\$#])([\w\-_\.]+)';

    In php 7.3 preg_match needs the dash (“-“) escaped.

    My widget now works as well.
    No more fatal error exceptions (nor warnings).

    • This reply was modified 5 years, 7 months ago by 22-7ths.
    • This reply was modified 5 years, 7 months ago by 22-7ths.
    • This reply was modified 5 years, 7 months ago by 22-7ths.

    Thank you @22-7ths !

    Thank you @22-7ths ! It works!

    @22-7ths It works. Thanks!

    Thanks @eizzumdm ! it works.
    Does someone know if Mailpoet has fixed the issue ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Subscription Widget exception errors under PHP 7.3’ is closed to new replies.