SOLVED: Custom Code Revisions in Page Settings Not Saving Properly

Browser: Microsoft Edge 120,Chrome 120
OS: macOS / Windows / Linux / etc.

Following the update to version 1.9.5, I’ve noticed an issue when attempting to modify custom code in the page settings (header, body, footer). Initially, upon saving changes, everything functions as expected. However, when I attempt to revise the code, the changes do not take effect and the system reverts to the previous code.

I’ve verified this issue on two live websites running version 1.9.5, confirming the presence of this bug.

Hi @yusuf ,

Please may I have an example of your scripts so I can try it locally?
In what type of template? Single, section, or direct edit the Page?
How about if reverts to 1.9.4, the editing works as usual?

Regards,
Jenn

Hi @itchycode
This code is what I’ve used in Woo archive template, changing filters position in screens below 991px.
when i was trying to change var filtersBlock = $('.product-archive__filters-block'); CSS selector and save template, the changes do not take effect and the system reverts to the previous code. I should remove the code, save the template and change it locally in my system and put it there again
Body (footer) scripts:

<script>
jQuery(function($) {
  var filtersBlock = $('.product-archive__filters-block');
  var filtersOffcanvas = $('.product-archive__filters-offcanvas');
  var originalContainer = $('.product-archive__products-container');

  function moveFilters() {
    var screenWidth = $(window).width();

    if (screenWidth <= 991 && !filtersBlock.parent().is(filtersOffcanvas)) {
      // Move the element to the offcanvas container only if it's not already there
      filtersBlock.removeClass('visible');
      filtersOffcanvas.append(filtersBlock);
      setTimeout(function() {
        filtersBlock.addClass('visible'); // Add the visible class with a small delay to avoid CLS
      }, 0);
    } else if (screenWidth > 991 && !filtersBlock.parent().is(originalContainer)) {
      // Move the element back to its original container only if it's not already there
      filtersBlock.removeClass('visible');
      originalContainer.append(filtersBlock);
      setTimeout(function() {
        filtersBlock.addClass('visible'); // Add the visible class with a small delay to avoid CLS
      }, 0);
    }
  }

  // Call moveFilters immediately to ensure correct placement on page load
  moveFilters();

  // Listen for window resize events to handle changes in screen width
  $(window).on('resize', moveFilters);
});
</script>

Hi @yusuf ,

Thank you so much for the script.
I tried on the local Woo Archive template.
However, I can amend the code and the code changed accordingly.
The latest code shows even after reloading the builder.
Can you send admin access to help@bricksbuilder.io and include this forum thread as a reference? (please use your purchased license email for verification)
I would like to check the root cause.
Thanks.

Regards,
Jenn

@itchycode
I retested this on a recently developed website that I am currently working on. While attempting to import my code into the custom code section of the page settings, I noticed that the changes were not being applied. Furthermore, in the builder, even after saving and refreshing the page, all modifications in that section disappeared completely and had no effect. However, upon reverting to version 1.9.4, everything functioned seamlessly.

Hi @yusuf ,

May I know how you"import" the code?
Can you send admin access to help@bricksbuilder.io and include this forum thread as a reference? (please use your purchased license email for verification)

Regards,
Jenn

@itchycode easly typing in or control v and control c . unfortunately at the moment can’t share live website. but the bug exist. the only way is downgrade import the code and upgrade again.

Hi @yusuf ,

I am sorry that I and other team members can’t reproduce your issue.
Can you check the browser dev tool console log tab or network tab and see if any errors there?
Is it possible that certain plugins causing the issue?
Since we can’t access your website for check, I can only keep this forum thread as “WAIT” until you can provide a way for us to replicate the issue.

Regards,
Jenn

1 Like

It works as expected in 1.9.6.

1 Like