Forum

Thread tagged as: Problem, Error

2.8.27 issue with javascript

Hi Drew,

I updated a site yesterday with the 2.8.27 update but noticed that all the javascript functionality failed. (bxslider an image slideshow &c.) I've rolled back to the previous version of "core" and all the functionality has returned.

Is this an issue with the update or an issue with the jquery plugins I'm using?

Nick Loat

Nick Loat 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2591 points
Perch Support

This is JavaScript on the front end of your site?

Yes. Was working OK prior to applying update and is working again after rolling back to the backup of core. But stopped working under 2.8.27 nothing else had been updated or changed.

Drew McLellan

Drew McLellan 2591 points
Perch Support

How is it failing, and where does it touch Perch?

the site is raptureandwright.co.uk.

The two main failings that I noticed were the "sliders" (bxslider) and the image viewer/zoom.

both elements use perch to populate them with images/content but after the update the sliders didn't show at all and the image/zoon failed to load the images.

Drew McLellan

Drew McLellan 2591 points
Perch Support

I don't follow what that has to do with Perch. Were you getting errors in your browser console? Had the HTML output changed?

Drew, I'll have to do some investigation. All I know is when the update was applied the plugins stopped working. When it was reverse they worked again.

I'll do some testing and get back to you,

Hi Drew,

I've done a little testing. I've applied the 2.8.27 to the test server and the same thing happens. No js errors in the browser console, however looking at the code output for the page is appears that the links to jQuery and other javascript elements aren't being included.

In the template I'm using <?php perch_content_custom('Javascript'); ?> to create a region (shared) which pulls in a javascript.html content template which contains links to jquery and code for various plugins &c.. However that doesn't appear to be happening which inturn means the javascript elements of the site either don't appear (in the case of the sliders) or don't work as in the case of the image viewer.

Drew McLellan

Drew McLellan 2591 points
Perch Support

So you're saying a shared region isn't outputting the content that it should?

Yes.

The test site is rw.loatdavies.com and the live site is raptureandwright.co.uk if you look at the code of the homepage of both sites you'll see that all the javascript links/code at the bottom of the live site isn't present on the test server running 2.8.27

Drew McLellan

Drew McLellan 2591 points
Perch Support

If you add the following to a fresh page, what does it output?

<?php perch_content('Javascript'); ?>

That seems to work.

Generally should I be using perch_content as opposed to perch_content_custom?

Drew McLellan

Drew McLellan 2591 points
Perch Support

If you're not using sorting and filtering, then use perch_content()

OK. As always, thanks for your patience.