This issue arose when user was attempting to use the Colibri theme with Certificates, and getting a fatal error on previewing the template. Note that the user is using the Pro version; the link above is to free.
After enabling Query Monitor, the detailed error is:
Note: user was using PHP 8.0.26 when the issue was originally reported.
Testing:
I can duplicate this error by setting PHP to version 8.x (on Pressable, 7.4 seems to work), and with or without Colibi active, when creating and previewing a NEW certificate template.
The user contacted Colibri, who responded:
in the ../sensei-certificates/classes/class-woothemes-sensei-certificate-templates.php file, lines 444-449 don't reflect the correct defaults as shown on lines 283-290. This results in `$font['font_style']` returning an empty array on line 722 instead of an empty string. This will not cause an issue on PHP7, types don't cause fatal errors.
Solutions [for user]:
- ask the Sensei Certificates developer to fix the issue in an update, you can mention to them what we wrote above.
- downgrade to PHP7
- select a font style so that it doesn't return an empty array and the preview will work, please see -> https://bit.ly/3WTha2P
On an existing template, I attempted to set the fonts for each part of the template as Colibri indicated above, and still generated the error seen in the above screenshot.
In addition to setting the fonts, I had to EITHER:
set a default font style (bold/italic)
set a font style for each component
Also: if you set just the default font AND style, you don't have to set component fonts or styles.
So, a slightly caveat-ed confirmation that Colibri's solution works in 8.0, 8.1.
8.2 generates a 502 bad gateway error I can't seem to track down.
reported in 5896322-zen
This issue arose when user was attempting to use the Colibri theme with Certificates, and getting a fatal error on previewing the template. Note that the user is using the Pro version; the link above is to free.
After enabling Query Monitor, the detailed error is:
Note: user was using PHP 8.0.26 when the issue was originally reported.
Testing:
I can duplicate this error by setting PHP to version 8.x (on Pressable, 7.4 seems to work), and with or without Colibi active, when creating and previewing a NEW certificate template.
The user contacted Colibri, who responded:
On an existing template, I attempted to set the fonts for each part of the template as Colibri indicated above, and still generated the error seen in the above screenshot.
In addition to setting the fonts, I had to EITHER:
Also: if you set just the default font AND style, you don't have to set component fonts or styles.
So, a slightly caveat-ed confirmation that Colibri's solution works in 8.0, 8.1.
8.2 generates a 502 bad gateway error I can't seem to track down.
PHP 7.4, 8.0, 8.1, 8.2 WP: 6.1.1 Sensei Pro: 4.11.0.1.11.0 Certificates: 2.3.0