Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #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.

    #1042072

    Hey 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,
    Rikard

    #1046435

    Hello,

    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!

    #1046868

    Sorry, 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.

    #1047918

    Hi,

    We have reported to our developers so they can review!
    Thank you for your kind words, we appreciate them a lot!

    Best regards,
    Basilis

    #1073371

    Need a fix for this. Thanks!

    #1073373

    Is 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 607

    On 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,
    -Rob

    #1073374

    Line 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!

    #1073861

    Hi 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,
    Rikard

    #1075604

    That works! Thank you.

    #1076219

    Hi,

    Great, I’m glad you got it working. Please let us know if you should need any further help on the topic.

    Best regards,
    Rikard

    #1085641

    Turning off error reporting does not solve the problem and prevents me from seeing any other errors – any word on a solution?

    Thank you!

    #1087238

    Hi,

    Unofrutnately no – as error reporting will not show what is wrong and this should work.

    Best regards,
    Basilis

    #1087247

    I 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.php

    LINE 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!

    #1087534

    Hello 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!

    #1087745

    Hi,

    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ünter

    #1139980

    In 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.

    #1139984

    What 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, 3 months ago by Manny Rodrigues. Reason: update
Viewing 18 posts - 1 through 18 (of 18 total)
  • You must be logged in to reply to this topic.