-
AuthorPosts
-
June 23, 2023 at 5:32 pm #1411498
Using the latest Enfold (v5.6.2) there are two errors in how Avia is parsing shortcodes.
1. enfold/config-templatebuilder/avia-template-builder/php/class-shortcode-parser.php – In check_wp_result_array(), it tries to access $sc[1] outside of the loop that creates the $sc variable.
2. enfold/config-templatebuilder/avia-template-builder/php/class-shortcode-parser.php – In balance_shortcode(), in the first preg_match_all it has this line:
“/” . ShortcodeHelper::get_fake_pattern(false, $shortcodes) . “/s”
which fails when GravityView is installed and being used. It is unable to parse the following shortcodes properly due to the extra slash: [gv\widgets\page_size] [/gv\widgets\page_size]
These two errors cause continue errors to be generated in the error_log
[21-Jun-2023 15:22:26 UTC] PHP Warning: preg_match_all(): Compilation failed: unknown property name after \P or \p at offset 5747 in /chroot/home/USERNAME/DOMAIN/html/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/class-shortcode-parser.php on line 562June 24, 2023 at 10:39 pm #1411579Hey lzevon,
Glad you were able to find the issue is with the slashs in the GravityView shortcode, slashs in shortcode is very unusual, have you tried to escape the slashs like this:
[gv/\widgets/\page_size] [/gv/\widgets/\page_size]
If that doesn’t work then try making a new shortcode with no slashs to call that shortcode using do_shortcode
I don’t see that we can correct this plugin in the theme.Best regards,
MikeJune 30, 2023 at 8:27 pm #1412193Mike,
So i dug further and it’s not a matter of even using it in the content anywhere. Just by virtue of having the plugin (GravityView) installed is causing this error.
“I don’t see that we can correct this plugin in the theme.” – It’s not a matter of fixing the plugin, it’s about fixing how the theme handles shortcodes from other developers. Enfold’s “balance shortcode” feature is what is throwing the errors. Somehow, however Enfold grabs the available shortcodes it’s trying to balance, it grabs that as one of the available shortcodes. It tries to create a regex from it and fails.
In class-shortcode-parser.php in
balance_shortcode()
this is the$shortcodes
variable it’s trying to process and dying on. With that you should be able to patch the theme so it handles anomalies like this properly.Array ( [0] => wp_caption [1] => caption [2] => gallery [3] => playlist [4] => audio [5] => video [6] => embed [7] => expand [8] => colomat [9] => expandsub1 [10] => expandsub2 [11] => expandsub3 [12] => expandsub4 [13] => expandsub5 [14] => expandsub6 [15] => expandsub7 [16] => expandsub8 [17] => expandsub9 [18] => expandsub10 [19] => expandsub11 [20] => expandsub12 [21] => expandsub13 [22] => expandsub14 [23] => expandsub15 [24] => expandsub16 [25] => expandsub17 [26] => expandsub18 [27] => expandsub19 [28] => expandsub20 [29] => expandsub21 [30] => expandsub22 [31] => expandsub23 [32] => expandsub24 [33] => expandsub25 [34] => expandsub26 [35] => expandsub27 [36] => expandsub28 [37] => expandsub29 [38] => gv_note_add [39] => gv_entry_link [40] => gv_edit_entry_link [41] => gv_delete_entry_link [42] => year [43] => av_privacy_allow_cookies [44] => av_privacy_accept_essential_cookies [45] => av_privacy_google_tracking [46] => av_privacy_google_webfonts [47] => av_privacy_google_maps [48] => av_privacy_video_embeds [49] => av_privacy_google_recaptcha [50] => av_privacy_custom_cookie [51] => av_privacy_accept_button [52] => av_privacy_accept_all_button [53] => av_privacy_do_not_accept_button [54] => av_privacy_modal_popup_button [55] => av_privacy_link [56] => av_privacy_cookie_info [57] => av_sb_instagram_feed [58] => av_leaflet_map [59] => av_productgrid [60] => av_productlist [61] => av_product_button [62] => av_product_info [63] => av_product_review [64] => av_product_tabs [65] => av_product_upsells [66] => avia_sc_product_meta [67] => av_product_price [68] => av_productslider [69] => gravityform [70] => gravityforms [71] => wpseo_breadcrumb [72] => gravityview [73] => gventry [74] => gvfield [75] => gvlogic [76] => gvlogic2 [77] => gvlogic3 [78] => gvlogicelse [79] => tribe:event-details [80] => boxzilla_link [81] => av_player [82] => av_playlist_element [83] => av_blog [84] => av_buttonrow [85] => av_buttonrow_item [86] => av_button [87] => av_button_big [88] => av_catalogue [89] => av_catalogue_item [90] => av_chart [91] => av_chart_dataset [92] => av_codeblock [93] => av_one_full [94] => av_one_half [95] => av_one_third [96] => av_two_third [97] => av_one_fourth [98] => av_three_fourth [99] => av_one_fifth [100] => av_two_fifth [101] => av_three_fifth [102] => av_four_fifth [103] => av_comments_list [104] => av_contact [105] => av_contact_field [106] => av_content_slider [107] => av_content_slide [108] => av_countdown [109] => av_events_countdown [110] => av_upcoming_events [111] => av_gallery [112] => av_horizontal_gallery [113] => av_google_map [114] => av_gmap_location [115] => av_layout_row [116] => av_cell_one_full [117] => av_cell_one_half [118] => av_cell_one_third [119] => av_cell_two_third [120] => av_cell_one_fourth [121] => av_cell_three_fourth [122] => av_cell_one_fifth [123] => av_cell_two_fifth [124] => av_cell_three_fifth [125] => av_cell_four_fifth [126] => av_heading [127] => av_headline_rotator [128] => av_rotator_item [129] => av_hr [130] => av_font_icon [131] => av_icon_circles [132] => av_icon_circle_item [133] => av_icon_box [134] => av_icongrid [135] => av_icongrid_item [136] => av_iconlist [137] => av_iconlist_item [138] => av_image [139] => av_image_diff [140] => av_image_hotspot [141] => av_image_spot [142] => av_partner [143] => av_partner_logo [144] => av_lottie [145] => av_magazine [146] => av_mailchimp [147] => av_mailchimp_field [148] => av_masonry_entries [149] => av_masonry_gallery [150] => av_submenu [151] => av_submenu_item [152] => av_notification [153] => av_animated_numbers [154] => av_portfolio [155] => av_post_metadata [156] => av_metadata_item [157] => av_postcontent [158] => av_postslider [159] => av_progress [160] => av_progress_bar [161] => av_promobox [162] => avia_sc_search [163] => av_section [164] => av_slideshow [165] => av_slide [166] => av_slideshow_accordion [167] => av_slide_accordion [168] => av_feature_image_slider [169] => av_fullscreen [170] => av_fullscreen_slide [171] => av_slideshow_full [172] => av_slide_full [173] => av_social_share [174] => av_tab_section [175] => av_tab_sub_section [176] => av_table [177] => av_row [178] => av_cell [179] => av_tab_container [180] => av_tab [181] => av_team_member [182] => av_team_icon [183] => av_testimonials [184] => av_testimonial_single [185] => av_textblock [186] => av_timeline [187] => av_timeline_item [188] => av_toggle_container [189] => av_toggle [190] => av_video [191] => av_sidebar [192] => av_dropcap1 [193] => av_dropcap2 [194] => gravityview_widget_search [195] => gravityview_widget_custom_content [196] => gravityview_widget_gravity_forms [197] => gv\widgets\page_size [198] => gravityview_widget_pagination_info [199] => gravityview_widget_page_links )
July 1, 2023 at 1:29 pm #1412206Hi,
Thanks for the feedback, I have reported this to the Dev Team for their review and either I or another member will reply back, Thank you for your patience.Best regards,
MikeJuly 12, 2023 at 4:53 pm #1413152Just following up, any update on this?
July 13, 2023 at 12:04 pm #1413227Hi,
The Dev Team says they have made an adjustment that will be in v5.6.4
Below I have linked the /enfold/config-templatebuilder/avia-template-builder/php/class-shortcode-parser.php that you can test with.
Please keep a copy of your current file for fallback.Best regards,
MikeJuly 18, 2023 at 4:26 pm #1413616That looks 5.6.4 like it fixed that issue, thanks!
The only error I still see in the error logs is:
[18-Jul-2023 14:20:09 UTC] PHP Warning: Undefined array key "term_rel" in /chroot/home/USER/DOMAIN/html/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/blog/blog.php on line 562
That line of code is:
if( $atts['term_rel'] != 'AND' ) { $atts['term_rel'] = 'IN'; }
Which looks like it’s missing a
isset( $atts['term_rel'] )
and then it should be good to go. Thanks for taking care of that other issue though!July 19, 2023 at 3:44 pm #1413721Hi,
The Dev Team has this patch and plans to release an update with the fix over the next few days.
Thank you for your patienceBest regards,
Mike -
AuthorPosts
- The topic ‘Error in Avia Shortcode Parser’ is closed to new replies.