Tagged: critical error
-
AuthorPosts
-
March 15, 2021 at 3:50 pm #1288323
Hello,
I’m a long time Enfold user and the site I am updating has been an Enfold site for six years. I tried updating it on Thursday and using the navigation to visit any other page results in a critical error. Fortunately I used a backup plugin and restored the site back to the pre-update version.I’ve read a few threads in the forums, following the instructions found in one, I’ve installed a new version of the theme via ftp. This still gives me the same results. As this is a live website, I really can’t leave it like this, so I’ve restored it again.
Is this a known issue, and should I just wait for V4.8.2?
EDIT:
I should also add that Critical Error page I mention is not central in the browser window, it looks like it’s shifted approximately 500px to the right.- This topic was modified 3 years, 9 months ago by jonrouse. Reason: Extra details
March 16, 2021 at 1:20 pm #1288510Hello,
I set up a staging site and finally got the issue down to some PHP, which was given to me by Yigit in this thread.add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
Going even further back Josue helped me here, and the fix Yigit gave me basically allowed me to copy shortcodes/av-helper-slideshow.php and have my custom version living in the child theme. Has the name or location of av-helper-slideshow.php in the main theme changed?
This is a long story, but the client didn’t want the slider to be too big on a wide page, so Josue gave me code to switch out to a widescreen version at a certain pixel width.
Just wondering if there’s a simple fix,
Cheers
JMarch 16, 2021 at 1:38 pm #1288518Hey J,
Thanks for contacting us!
No, the code actually has not changed. I wanted to check your page on staging site however it seems like we need logins. Could you please temporary admin logins to your staging site so we can look into it? If possible, please post FTP logins as well :)
Regards,
YigitMarch 16, 2021 at 1:48 pm #1288525Hi Yigit,
I don’t have FTP any more, but I’ve created a login below which I hope helps.
The php on staging current has a/* */
wrapped around it
Thank you!March 18, 2021 at 5:26 am #1288879Hi jonrouse,
I believe your issue is similar to https://kriesi.at/support/topic/homepages-wont-load-after-upgrading-to-both-4-8-and-4-81/#post-1288743
Your av-helper-slideshow.php in the child theme might be missing this static function: default_argsBest regards,
Nikko- This reply was modified 3 years, 9 months ago by Nikko. Reason: fix grammer
March 18, 2021 at 11:20 am #1288925Hi Nikko,
Thanks for getting back to me. I have no clue when it comes to PHP and just followed Yigit and Josue’s instructions.
Have you amended the file using the admin access? If not, could you tell me where to add please?Thanks
March 18, 2021 at 12:09 pm #1288941I’ve tried my hardest to get this to work by adding in default_args and get nothing but errors
static public function default_args( array $sc_defaults = array() ) { $default = array( 'size' => 'featured', 'lightbox_size' => 'large', 'animation' => 'slide', 'transition_speed' => '', // in ms - empty for default 'conditional_play' => '', 'ids' => '', 'video_counter' => 0, 'autoplay' => 'false', 'bg_slider' => 'false', 'slide_height' => '', 'handle' => '', 'interval' => 5, 'class' => '', 'el_id' => '', 'css_id' => '', 'scroll_down' => '', 'control_layout' => '', 'content' => array(), 'custom_markup' => '', 'perma_caption' => '', 'autoplay_stopper' => '', 'image_attachment' => '', 'min_height' => '0px', 'lazy_loading' => 'disabled' ); if( empty( $sc_defaults ) ) { return $default; } /** * Override the defaults from shortcode options for backwards comp. */ return array_merge( $sc_defaults, $default ); }
March 18, 2021 at 12:11 pm #1288943It seems the lines of code Josue gave me here don’t have the same attributes so I can’t apply the modifications he gave me to the latest version of av-helper-slideshow.php
March 18, 2021 at 1:34 pm #1288976Hi jonrouse,
Inside av-helper-slideshow.php, find this class: avia_slideshow, inside that class find this code/function:
public function __destruct() { unset( $this->config ); unset( $this->slides ); unset( $this->id_array ); }
Then add the default_args function below it.
Best regards,
NikkoMarch 18, 2021 at 2:17 pm #1288989Hi Nikko,
My av-helper-slideshow.php doesn’t have those functions in it, it begins:
class avia_slideshow { static $slider = 0; //slider count for the current page protected $config; //base config set on initialization protected $slides; //attachment posts for the current slider protected $slide_count = 0; //number of slides protected $id_array = array(); function __construct($config)
It’s the same code Yigit helped me placing into the child theme with five years ago. The code in the latest version of the theme doesn’t match up with what Josue gave me initially, which is what I’ve been using ever since (part of it looks like this):
$html .= "<img class='img_default' src='".$img[0]."' width='".$img[1]."' height='".$img[2]."' title='".$linktitle."' alt='".$linkalt."' $markup_url />";
The closest thing I can find in the new theme version is
$img_tag = "<img src='{$img[0]}' width='{$img[1]}' height='{$img[2]}' title='{$linktitle}' alt='{$linkalt}' {$markup_url} {$img_style} />";
I’ve tried to amend the new theme using the original instructions here and it broke the slider!
Really not sure what to do now. Originally the client was unhappy that on large screens the slider was virtually 100% vh. Essentially, the purpose was to change the slider height when viewing the site on larger screens. Josue helped me so that when the screen went over 1500px wide, the height of the slider changes to a scaled version of the original image, which are 3264 x 765 px. It’s been working fine for five years. You can see it working on the live site – linked below.
March 18, 2021 at 4:49 pm #1289021Hi jonrouse,
Can you send to us your av-helper-slideshow.php?
You can post it in https://ufile.io/ or dropbox, then post the link in private content, so we can review the file.Best regards,
NikkoMarch 18, 2021 at 5:16 pm #1289024Hi Nikko,
That’s a great service, I’ve just done that – link in private content. Thanks for all your help with this.March 19, 2021 at 5:36 am #1289093Hi jonrouse,
Thanks, try using this file.
I have updated it based on Enfold 4.8.1Best regards,
NikkoMarch 19, 2021 at 11:16 am #1289134Hi Nikko,
Thanks so much for this. I added it to the child theme within the staging environment. Sadly, it is not quite working. If you check the link in the private area, it does not resize when reducing down to 1500px or less. It just uses the wide image and scales it down. This is the CSS I was provided with, do you see anything in this which needs to change?
img.img_full{ display: none !important; } @media only screen and (min-width: 1500px) { img.img_full { display: block !important; } img.img_default{ display: none !important; } }
Thanks again for you patience and perseverance!
- This reply was modified 3 years, 9 months ago by jonrouse. Reason: Enfold versions in private
March 19, 2021 at 1:43 pm #1289166Hi jonrouse,
I see, can you try this file instead (link in private content) :)
Best regards,
NikkoMarch 19, 2021 at 3:13 pm #1289199Thank you Nikko.
I’ve just replaced that in the staging child theme (and emptied cache) and it’s the same I’m afraid. Sorry!For some reason some of the links on the staged version are linking to the live site, easier for me to see as the WP tool bar changes from orange to black.
The staging pages seem to be those with plain permalinks, not sure if that’s any help, but I thought it was worth mentioning.Thanks again.
March 19, 2021 at 3:52 pm #1289214Hi jonrouse,
I see, can you give temporary admin access to the staging site?
Just post the credentials in private content.Best regards,
NikkoMarch 19, 2021 at 4:02 pm #1289220Hi Nikko,
Sure, I did set this up a few days agoMarch 20, 2021 at 3:28 pm #1289355Hi jonrouse,
Thanks, can you give us steps on how we can change our IP address? since I don’t know how to do it.
Best regards,
NikkoMarch 22, 2021 at 11:22 am #1289592Hi Nikko,
Reply below
March 23, 2021 at 2:05 pm #1289866Hi jonrouse,
Please check in private content.
Best regards,
NikkoMarch 23, 2021 at 2:32 pm #1289878Thanks Nikko, give it a try. Fingers crossed!
March 24, 2021 at 8:24 am #1290045Hi jonrouse,
I tried to access but I’m getting this: (my IP is still the same)
Forbidden You don't have permission to access this resource.
Best regards,
NikkoMarch 24, 2021 at 12:12 pm #1290078Hi Nikko,
Maybe I need to grant access to the main site and you can access staging through there.
Please check private content.
ThanksMarch 24, 2021 at 2:05 pm #1290117Hi jonrouse,
Thanks, I have modified the code and I forgot the dot, here’s the lines/codes I have changed:
line 381, from:
$img_tag = "<img src='{$img_full[0]}' width='{$img_full[1]}' height='{$img_full[2]}' alt='{$imgalt}' />";
to:
$img_tag .= "<img src='{$img_full[0]}' width='{$img_full[1]}' height='{$img_full[2]}' alt='{$imgalt}' />";
line 751, from:
$img_tag = "<img src='{$img_full[0]}' width='{$img_full[1]}' height='{$img_full[2]}' alt='{$linkalt}' />";
to:
$img_tag .= "<img src='{$img_full[0]}' width='{$img_full[1]}' height='{$img_full[2]}' alt='{$linkalt}' />";
Best regards,
Nikko- This reply was modified 3 years, 9 months ago by Nikko.
March 24, 2021 at 2:24 pm #1290129Thanks Nikko,
I can see that something has definitely changed, so thank you. However, when I visit the pages on staging I am seeing both versions of the image stacked on top of one another. I’m guessing you’re not seeing this? Link below for reference.Sorry this has turned into such a pain of a job!
March 24, 2021 at 3:53 pm #1290142Hi jonrouse,
No worries and thanks for your patience :)
It seems the CSS code for it did not work since the image does not have img_full class.
I have replaced it with this CSS code instead:.avia-slide-wrap > img:nth-child(2) { display: none; } @media only screen and (min-width: 1500px) { .avia-slide-wrap > img:nth-child(2) { display: block; } .avia-slide-wrap > img:nth-child(3){ display: none; } }
Best regards,
NikkoMarch 24, 2021 at 4:44 pm #1290168That’s nearly there! It should be the other way around; so the taller image is displayed on sizes below 1500px, the wider image on sizes above 1500px. Hope this makes sense!
March 24, 2021 at 4:51 pm #1290175Hi jonrouse,
I see, please replace it with this code (basically 2 and 3 in nth-child is swapped):
.avia-slide-wrap > img:nth-child(3) { display: none; } @media only screen and (min-width: 1500px) { .avia-slide-wrap > img:nth-child(3) { display: block; } .avia-slide-wrap > img:nth-child(2){ display: none; } }
Best regards,
NikkoMarch 24, 2021 at 5:24 pm #1290185Perfect, that’s working great on the staging site!
Just to check, essentially, all I need to do now is
• update Enfold on the live site
• replace the av-helper-slideshow.php in the child theme
• replace those few lines of css with what you added above?Thank you, I owe you a beer or a cake or something!
-
AuthorPosts
- You must be logged in to reply to this topic.