Javascript Vanishes

Hello,

I am trying to make columns on our page into hyperlinks. I found the JS to do it via a support thread on here, but in turn I discovered a pretty huge bug - any javascript has no effect and vanishes once saved. I created a video to demonstrate this but I am not able to upload it here due to the file type limitations of your system.

Basically its reproduced as follows:

  1. Open page and click JS in left sidebar to enter javascript.
  2. Enter any javascript, it doesn’t matter what it is.
  3. Save the page. Then refresh with F5. Open the JS box in left sidebar. Any JS entered is now gone and the default msg is back.

Do you have a workaround for turning entire columns into links that doesn’t involve JS until you guys fix this bug? Thanks.

Hi There,

Thanks for writing in!

The message can be caused by the following:

Update: Please check if you are using the latest version of theme and plugins. If no please update it.

Caching. If you have a caching plugin activated or any form of server side caching please disable it to test for any possible conflicts. If you have server side caching or aren’t sure if you do, your host should be able to advise of this and disable it for testing purposes on your account.

Cloudflare. If you are using Cloudflare please disable this for testing purposes. Cloudflare by default enables an auto minfication function to compress the JS and CSS files of the theme. As the theme already serves minified files, re-minifying said files only causes to break the entire site.

Custom code syntax error. If you have a child theme, please enable the child theme and check if the issue still exists. If you have entered any custom JS or CSS into their respective editors. Please review the code for any syntax errors. A mis-placed semi-colon or a missing bracket will cause the issue you’re seeing.

If that doesn’t help Please send us your login details in a secure note, so that we can have a look. Also provide the JS code.

Thanks!

None of those are factors on this site. It’s a bug with your editor.

Tried this: jQuery("#column-link").wrap("<a href='http://www.example.co.uk/get-in-touch/'></a>");

I tried this: (function( $ ) { $(function() { var theColumn = $('.marginless-columns .x-column'); theColumn.css('cursor', 'pointer'); theColumn.each(function() { var theLink = $(this).find('a').attr('href'); $(this).on('click', function(){ window.location.href = theLink; }); }); }); })(jQuery);

Everything put into the JS box gets wiped out after save.

See secure note for a login.

Hi There,

I have created a test page on your site (see secure note) and I could not experience this issue.

Could you please provide us with the specific page that you’re having this issue, so that we can check.

Thanks!

On the homepage. Trying to make the Corvette and Camaro columns into links. Using page JS, not global.

Hello There,

I have copied your homepage into the test page. I inserted yourJS code and added a link in the columns. The JS code were saved and it works on the page.

Please test the link in the secure note.

This is not the experience we encounter. See https://youtu.be/Jwuog-Y-ggk

Hello There,

I can confirm that the issue is happening while editing your homepage. It maybe not being save due to a fatal error which is usually an exhaustion of PHP memory limit. ​Could you please increase your memory allocated to PHP? To increase it, please edit your wp-config.php file and insert these lines:

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

You can add it before the line
/*That's all, stop editing! Happy Blogging. */

We would loved to know if this has work for you. Thank you.

Memory limit is already 256MB on all sites and there is no need to raise it higher. The Pro theme works without issues on 15+ sites we use, all on the same server platform.

Checking our PHP error logs for this site, there are no fatal errors at all, just some unrelated warnings from a week ago. It’s not a PHP thing. Looks like we found a bug, folks.

Hi there,

It’s not a bug, else, everyone should get the same issue. It’s only specific to your setup and home page.

On my test, the success message appears instantly as it likes it doesn’t process any request at all. Would you mind providing your FTP login credentials too? I see the similar issue and it’s due to cache, and the cache is based on URL, and any page assigned as home page will not work since it uses the same URL.

Thanks!

I hope you realize that a software is bug is essentially “Does the function work the way it is intended?” If no, it’s a bug. The bug may be caused by certain situations but ultimately it’s a bug. Even if it just occurs on a single system.

This site is in development and has no caching plugins active. So if it’s a cache issue, you’ve got me as to how that could be. FTP login in secure note…

Hi there,

Yes, it should work the way it is, it works in all of our setup and to other users. It’s only specific to your site so we can’t rule out that this is a bug. It could be an issue just in your setup but not in the software itself.

There are many factors why a software can’t work, that includes the environment where it runs. An example is a 64bit software can’t run on a 32bit environment, it’s not a bug. I’m not trying to argue but just explaining that we can’t rule this out as a bug as of yet.

Now, this is what I found. I deactivated the entire plugin folder through FTP, then the javascript starts saving. I added a line //A TEST in your home page’s custom javascript.

You could try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Thanks.

We’ve identified it as a conflict between Pro and the Essential Add-Ons plugin for Pro. As this is a major add-on for the Pro editor, I’ve alerted the author but wanted you to know as well.

Thanks for the heads up , I also noted that in case we’ll see similar issue in the future.

Thanks for sharing :slight_smile:

Wanted to follow-up to let you know it may be time to start looking into how your page JS/CSS interacts with plugins. Discovered today that both page CSS and JS is blocked (not saved) when Yoast SEO is active. Same page as earlier in the ticket.

Thanks @co50 for the update, this has been reported to our dev team and it will be addressed in the next release.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.