Tagged: enfold, error, PHP Warning, shortcode-parser.class.php
-
AuthorPosts
-
December 6, 2018 at 9:37 pm #1041844
Upgraded to v4.5.1 and noticed that when trying to preview the changes made to a page I receive the following error message(s):
Warning: preg_match_all(): Compilation failed: unknown property name after \P or \p at offset 6440 in /home/xyz/public_html/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/shortcode-parser.class.php on line 607
Note that if I publish the changes, no error message(s) appear on the page. So this isn’t a big issue, unless you frequently “preview” your changes.
Hope this helps.
December 7, 2018 at 3:32 pm #1042072Hey endurox,
Thanks for reporting. Could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply. Also please point out on which page you are getting the warning in question.
Best regards,
RikardDecember 17, 2018 at 7:07 pm #1046435Hello,
I’m seeing the same error. Also noticed in #1041844 the solution was to upgrade to a higher version of php, but I am at 7.2.13. Running Enfold 4.5.1 with WordPress 4.9.8 (had to downgrade from 5.01)
PHP Warning: preg_match_all(): Compilation failed: unknown property name after \P or \p at offset 4855 in /home/public_html/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/shortcode-parser.class.php on line 607
I found this solution for the same problem on a unrelated website – something about needing 3 backslahes \\\
Here is the example that was used:
$string = “\par hello \par world”;
$pattern = ‘/\\\par/’;
preg_match_all($pattern, $string, $matches);I hope that helps narrow it down.
You guys are doing a fantastic job – thank you!
December 18, 2018 at 2:27 pm #1046868Sorry, but I cannot give admin access to the site. The issue is replicable on a default installation of WP and Enfold and as you can see others have a similar problem. I apologize for this inconvenience and thank you for your time and support.
December 20, 2018 at 8:26 pm #1047918Hi,
We have reported to our developers so they can review!
Thank you for your kind words, we appreciate them a lot!Best regards,
BasilisMarch 1, 2019 at 8:14 pm #1073371Need a fix for this. Thanks!
March 1, 2019 at 8:22 pm #1073373Is there a workaround or something? Is this a PHP version issue? It seems like there are many instances of this issue in the forum but no responses that provide help.
When my client is trying to PREVIEW a page they are seeing the following warning repeated 3 times in the body of the page:
Warning: preg_match_all(): Compilation failed: unknown property name after \P or \p at offset 4669 in /oss/affiliations.sa/htdocs/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/shortcode-parser.class.php on line 607On POSTS, the same thing happens but it interferes with the CSS that positions the menu – so the menu floats in the middle of the content no matter where you scroll. It makes it difficult to judge if you have any issues in your post – and that’s the whole reason to use the PREVIEW feature.
Your help on a resolution for this is greatly appreciated!
Thanks,
-RobMarch 1, 2019 at 8:25 pm #1073374Line 607 referenced in the error is:
/** * Now find all shortcode tags [foo [/foo] * */ preg_match_all( "/" . ShortcodeHelper::get_fake_pattern( false, $shortcodes ) . "/s", $text, $sc_found, PREG_OFFSET_CAPTURE );
Why is this code producing a warning? Is there a way to turn the warnings off?
Thanks!
March 3, 2019 at 9:08 am #1073861Hi Rob,
You could try adding this to the very top of your functions.php file, just after the opening PHP tag:
error_reporting(0);
Best regards,
RikardMarch 6, 2019 at 8:10 pm #1075604That works! Thank you.
March 8, 2019 at 5:11 am #1076219Hi,
Great, I’m glad you got it working. Please let us know if you should need any further help on the topic.
Best regards,
RikardApril 1, 2019 at 6:30 pm #1085641Turning off error reporting does not solve the problem and prevents me from seeing any other errors – any word on a solution?
Thank you!
April 4, 2019 at 10:52 pm #1087238Hi,
Unofrutnately no – as error reporting will not show what is wrong and this should work.
Best regards,
BasilisApril 4, 2019 at 11:37 pm #1087247I agree with @env-jim
A quick patch to “mute” error messages on that preg_match_all function would be to add an “@” to the front of line 607.
I’ve tested it and my shortcodes appear to still be functioning. No more error notices upon preview and it doesn’t get reported in my error_log. NICE!
FILE:
/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/shortcode-parser.class.phpLINE 607
@preg_match_all( "/" . ShortcodeHelper::get_fake_pattern( false, $shortcodes ) . "/s", $text, $sc_found, PREG_OFFSET_CAPTURE );
Will try to get a developer to implement this or a better solution for future releases via github. Wish me luck!
- This reply was modified 5 years, 7 months ago by Manny Rodrigues.
April 5, 2019 at 5:42 pm #1087534Hello Basilis,
When you turn off error reporting like this, it not only hides your error, but any other error that we may want to be aware of.
Are you suggesting we not worry about the error, and that your solution is to turn off error reporting completely?
Thanks!
April 6, 2019 at 11:56 am #1087745Hi,
The solution with
@
mentioned here is a safe one because it only affects error reporting on this line.
To me it seems that the content of the page seems to contain elements (like
\par
??) that the preg_match gets in conflict when parsing the string.
To reproduce it I would need the shortcodes of the page.
If you cannot give me access to the page can you try to build a page with as few elements as possible where the problem occurs and send me the shortcodes in private content?
You need to enable ALB debug mode: Please enable debug mode by adding the code provided in this link to your functions.php file which can be accessed from Appearance > Editor
This lets you view the shortcode for all the page elements.
Best regards,
GünterSeptember 19, 2019 at 5:14 pm #1139980In the past I’ve resolved this issue (preg_match_all(): compilation failed: unknown…) by updating the version of PHP I had running. I didn’t see that in this thread and felt it worth mentioning.
September 19, 2019 at 5:29 pm #1139984What version did you upgrade to? I’m on 7.1 with no luck. Maybe 7.2 or 7.3? Don’t have access to that yet on my server. But thank you for replying with a potential solution.
- This reply was modified 5 years, 2 months ago by Manny Rodrigues. Reason: update
-
AuthorPosts
- You must be logged in to reply to this topic.