Fatal error version 2
-
Hi,
I know that version 2 is out off support but I’ve got a fatal error after updating wp to 5.2 could you please issue an update?
Een fout van het type E_PARSE werd veroorzaakt op regelnummer 1 van het bestand /mnt/web406/d3/83/59422483/htdocs/sitev3/wp-content/plugins/wysija-newsletters/helpers/render_engine.php(600) : eval()’d code. Foutmelding: syntax error, unexpected end of file
Thanks!
-
I have the same error in MailPoet 2 after upgrading to WordPress 5.2.
It’s happening on one site I maintain but not on another site.
I suspected incompatibility with another plugin, but deactivating all other plugins doesn’t cure the problem.I am working on upgrading to MailPoet 3 but I will need to leave MailPoet 2 activated so that the MailPoet 2 newsletter archive is accessible. Or is there another way to view the MailPoet 2 archive?
This is the message I see
The site is experiencing technical difficulties. Please check your site admin email inbox for instructions. PHP ERROR:array(4) { ["type"]=> int(4) ["message"]=> string(36) "syntax error, unexpected end of file" ["file"]=> string(115) "/home/xxxxxx/public_html/web/wp-content/plugins/wysija-newsletters/helpers/render_engine.php(600) : eval()'d code" ["line"]=> int(1) }I installed a debugging statement to display the variable which was causing the eval error.
The line of code in render_engine.php is$eval_string = sprintf ("if (%s){\$result=true;} else {\$result=false;}", $condition); @eval ($eval_string);And the value of $eval_string which gives the error is
if ( #image){$result=true;} else {$result=false;}PHP is not my speciality, but I think #image is an invalid variable name.
I’m not sure how to fix the problem, though.I’m getting the same error.
Rolling back to PHP 7.2 (from 7.3) prevents the error from occurring.
I’ve just finished migrating one of three websites that use MailPoet to version 3. For the other two that are still using version 2, I’ve had to roll back PHP to keep the sites functioning.
A fix for this issue would be appreciated…
Still no fix? Thats not very kind mailpoet team 🙁
Thanks @widecast for the temporary workaround.
I was on PHP 7.3.5.
After backing down to 7.1 or 7.2 the problem goes away (or is hidden).I still think that fixing MailPoet 2 is the wrong approach.
There should be a way to display the MailPoet 2 newsletter archive without requiring MailPoet 2 to be installed.
Maybe some way to export the SQL table containing the MailPoet 2 newsletters and import as normal posts which don’t require any special wysija CSS classes.Hi all,
This is a PHP compatibility issue. MailPoet 2 will not be updated to work with newer PHP versions. We recommend keeping to PHP 7.1 or 7.2 if you wish to run MailPoet 2.
Thanks.
The problem seems to lie in another line in /wp-content/plugins/wysija-newsletters/helpers/render_engine.php. The eval error mentioned by @adriandw is only an effect of a failing regexp parse. This warning is the real cause:
PHP Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 11 in XXX/web/wp-content/plugins/wysija-newsletters/helpers/render_engine.php on line 593The problem in that line is caused by this constant at line 43 of that file:
const _VAR = '([\$#])([\w-_\.]+)';In PHP 7.3, for some reason the dash in the second character class is interpreted as a range mark instead of a literal dash. Probably because now, you can make ranges between classes like \w.
So the fix is easy (and NOT worth the 19 dollars per site that some companies ask for it): change this line to
const _VAR = '([\$#])([\w\-_\.]+)';And all is fine again.
Hope to help you all out this way.
Regrds, Jelmer
-
This reply was modified 6 years, 6 months ago by
jelmerjellema. Reason: I hate code blocks with backticks. That's why
-
This reply was modified 6 years, 6 months ago by
jelmerjellema.
Thank you @jelmerjellema, that’s good to know.
I had been running my site on 7.2 to avoid the problem, so I just updated to 7.3 in preparation to apply your fix.
The level of PHP 7.3 available from my hosting provider is now 7.3.7.
And I have been unable to recreate the problem.
Is it possible this was recognised as a compatibility bug in PHP 7.3 and is now fixed in 7.3.7? It wasn’t clear from the changelog at https://www.php.net/ChangeLog-7.php#PHP_7_3Adrian
Strange… We run php 7.3.7 and did have this problem. Maybe some strange setting somewhere?
@jelmerjellema
It turns out the problem was still there – it just wasn’t showing me the error message in real-time.
But I received an email from WordPressYour Site is Experiencing a Technical Issue
WordPress caught an error with one of your plugins, MailPoet 2.So I applied your fix to render_engine.php and the problem went away.
Thank you againAdrian
Good to hear the fix worked out for you!
@adriandw don’t you feel bad taking over and mastering my post…?
The fix for me was upgrading to MailPoet 3.
So that’s all for now folks.
Mailpoet 3 is for a lot of people not a good fix on the short term. So the *fix* is my fix above, while the *solution* for the long term will be either buying MailPoet 3 or finding some other solution.
-
This reply was modified 6 years, 6 months ago by
The topic ‘Fatal error version 2’ is closed to new replies.