Can no longer load site after adding customizations


#1

I’ve been running Discourse successfully for about a week now. Everything has been working great! This morning I added a custom header (simple row of text pulling from a kimono API enclosed in bootstrap div tags). Suddenly users can’t click on random buttons. Logged in as admin, I first noticed the upload files/images button did not work. Then I noticed the logout button did not work. I opened a new, clean, browser and tried to login but the login and signup buttons don’t work. Back to my admin login, I tried to remove and/or disable the custom code, but it would not save - the save button did respond, but it gets frozen in a state of “Saving…” I logged in via ssh and did a rebuild, but am experiencing the same bugs.

I’m using 1.3.0.beta5 latest-release +83

Forum: https://cravetalk.org


(Jeff Atwood) #2

See


#3

Thank you. I tried this code:

./launcher enter app
rails c
SiteCustomization.update_all(enabled: false)

…with no success. The code above returned:

=> 1

Just out of curiosity I tried:

./launcher enter app
rails c
SiteCustomization.update_all(enabled: true)

…which also returned:

=> 1

We did test the code at JDFiddle; however, I’m sure it’s possible a conflict can still exist. Any other possible suggestions to try?


#4

I was able to confirm that “Enabled” is unchecked; however, the javascript customization persists and the site is still unusable - cannot click login or signup buttons, cannot click upload images/files button, can click the save button (in customizations) but it just hangs saying “Saving…”

Quick note, the javascript customization works just fine, as planned and expected. I have no idea what the conflict is or could be with Discourse.


(Kane York) #5

Are there any errors in the JS console?


#6

Two:

Uncaught TypeError: $replyControl.DivResizer is not a function

https://cravetalk.org/mini-profiler-resources/results Failed to load resource: the server responded with a status of 404 (Not Found)

(Kane York) #7

Hmmm, that would have to mean that some of the JS isn’t running or isn’t included. What happens if you rebuild?


#8

Nothing. A rebuild was one of the first things I tried. Issue persists. By the way, after a few reloads the second JS error disappeared. I only see the first error in the console.


(Kane York) #9

grep output for DivResizer:

jsapp/lib/div_resizer.js:  @module $.fn.DivResizer
jsapp/lib/div_resizer.js:$.fn.DivResizer = function(opts) {
jsapp/views/composer.js.es6:    $replyControl.DivResizer({

#12

Happy to report that the v1.3.0.beta6 +22 update fixed this issue. The enable/disable button now works.

I’m not entirely convinced that the issue was truly with the javascript we used. Is there a way to see if this truly introduced the conflict? Here’s the script we included in our :

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

<script>
$.ajax({
    "url":"https://www.kimonolabs.com/api/79ro6tus?apikey=tEVsBCaOxK6yC2nxy8E3QhKmVvOlo2JU",
    "crossDomain":true,
    "dataType":"jsonp",
    //Make a call to the Kimono API following the "url" 
    
    'success': function(response){ 
    // If the call request was successful and the data was retrieved, this function will create a list displaying the data
        
    $(".panel-heading").html(response.name);
    //Puts the API name into the panel heading  
        
    var collection = response.results.CRAVE;
    for (var i = 0; i < collection.length; i++){   
    // Traverses through every element in the entire collection 
        
        $(".list-group").append('<strong>PRICE:</strong>&nbsp;&nbsp;' + collection[i].price + '&nbsp;&nbsp;');
        $(".list-group").append(collection[i].change + '&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;');
        $(".list-group").append(collection[i].usd_price + '&nbsp;&nbsp;&nbsp;');
        $(".list-group").append('<strong> VOLUME:</strong>&nbsp;&nbsp;' + collection[i].btc_volume + '&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;');
        $(".list-group").append(collection[i].usd_volume + '&nbsp;&nbsp;&nbsp;');
        $(".list-group").append('<strong> MARKET CAP:</strong>&nbsp;&nbsp;' + collection[i].market_cap + '&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;');
        $(".list-group").append(collection[i].usd_market_cap + '&nbsp;&nbsp;&nbsp;');
        $(".list-group").append('<strong> AVAILABLE SUPPLY:</strong>&nbsp;&nbsp;' + collection[i].available_supply);
        // adds the text and the links from the first property into the list
      }
  }
 
  })
</script>