HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Vanilla moved to new server now missing checkbox tick icons

Hi,

I had a basic install of 3.1 using Boilerplate theme on a test server. All functioning OK. I've moved it to the live server with a different domain name, updated the config info for database - that seemed to go successfully and forum is working. However, I noticed that the tick icon on any checkboxes was missing. There's a 404 message in the browser console.

I've since upgraded the installation to 3.2 to see if this solves the problem - again this went smoothly, however the issue still persists. I've attached a screenshot with the console error.

Any help appreciated.

Cheers.

Comments

  • BTW, I can see this is a path issue as the URL does not include the sub-folder of the installation.

  • R_JR_J Ex-Fanboy Munich Admin


    Does that mean that your forum url is like "example.com/forum"? Then make sure that in your .htaccess file you modify the line

        #RewriteBase /
    

    accordingly to

       RewriteBase /forum
    


  • Yeah, I changed the .htaccess to

    RewriteBase /vanilla
    

    which is the directory of the installation. The 404 URLs are:-

    /resources/fonts/vanillicon/vanillicon.woff 

    Missing the /vanilla/

    No other 404s.

    Thanks.

  • R_JR_J Ex-Fanboy Munich Admin

    Hmm... When moving to the live server, have you also copied the /cache folder? If yes, try deleting /cache/Smarty/compile/*

    Or you can try deleting everything inside the /cache folder, just to be sure...

  • Yh, I've already deleted the cache folder and cleared browser cache etc. Been scratching my head over this....

  • charrondevcharrondev Developer Lead (PHP, JS) Montreal Vanilla Staff

    I think that’s controlled by some configuration of dashboard toggle. Will post here if I find what it is.

  • KasparKaspar Moderator
    edited September 2019

    font-family: "vanillicon";

    is not "loaded"

    In a install where it works it shows to be from

    /applications/dashboard/scss/vanillicon/_vanillicon-mixins.scss

    https://github.com/vanilla/vanilla/blob/master/applications/dashboard/scss/vanillicon/_vanillicon-mixins.scss

    However, neither a install which shows checked correct nor several installs that does not show it correct - have the SCSS folder in /applications/dashboard

    If I unstick the marked CSS - the checkbox changes


    On a install showing incorrect (showing the square box) unsticking the marked CSS - nothing changes.

  • Just a further note : I checked my initial demo install and it had the same problem (previously I had said it was fine). For the sake of the demo I added the files outside of the sub-directory to get it to work. This was a few months ago, so I must have intended to sort it out after the project got the go-ahead.

    This means that my initial install, following the install guides had the same issue, so confused that no-one else has faced this. I really can't see I'm doing anything out of the ordinary here.

  • edited September 2019

    There is this in the config:

    $Configuration['Vanilla']['AdminCheckboxes']['Use'] = true;

    It was set to false. I've changed it to true, but it hasn't made a difference.

    I've looked into this config and I don't think it is related anyway.

  • R_JR_J Ex-Fanboy Munich Admin

    No, that setting is unrelated to your problem.

    In the css there are the following lines:

    @font-face {
     font-family: "vanillicon";
     src: url("/resources/fonts/vanillicon/vanillicon.eot");
     src: url("/resources/fonts/vanillicon/vanillicon.eot?#iefix") format("embedded-opentype"), url("/resources/fonts/vanillicon/vanillicon.woff") format("woff"), url("/resources/fonts/vanillicon/vanillicon.ttf") format("truetype"), url("/resources/fonts/vanillicon/vanillicon.svg?#vanillicon") format("svg");
     font-weight: normal;
     font-style: normal;
    }
    

    As you can see the resources are absolute paths beginning from the root path. That might be a problem which needs to be fixed in the htaccess file (the htaccess file will not be overwritten, but changes made to the CSS file will most probably overwritten with the next update)

    I'm no RewriteRule expert but this might work

    RewriteCond /resources/%{REQUEST_URI} -f
    RewriteRule ^/resources/(.+)$ /vanilla/resources/$1
    

    But I thought that is what RewriteBase is used for. Are you sure that you have removed the "#" sign in front of the RewriteBase line?

  • OK, so the font is linked in the /applications/dashboard/design/admin.css file.

    All URLs to fonts are formed like this:-

    url("/resources/fonts/vanillicon/vanillicon.eot");

    Which is why they don't work.

    Am I really the only person seeing this issue?

  • R_JR_J Ex-Fanboy Munich Admin

    Can you please post the content of your .htaccess?

  • Hello friends,

    I'm Having the same problem, I've tried the suggestions for the .htaccess file but nothing worked, it works when I edit the admin.css file and add the sub folder to the URL path, but it will be overwritten after an update.

    My vanilla version is 3.3 and I'm using nginx as a revers proxy server with Apache.

    RewriteUrls is true in config.php.

    Here is the content of my .htaccess file, I just edited the "RewriteBase /" line-


    # Modified
    # If you modify this file then change the above line to: # Modified
    
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
    
        ####
        # Certain hosts may require the following line.
        # If vanilla is in a subfolder then you need to specify it after the /.
        # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
        ####
        RewriteBase /forum
    
    
        # Make sure that / doesn't try to go to index.php without a rewrite :)
        DirectoryIndex disabled
    
    
        ####
        # Deny access to certain directories that SHOULD NOT be exposed.
        ####
        RewriteRule (^|/)\.git - [L,R=403]
        RewriteRule ^cache/ - [L,R=403]
        RewriteRule ^cgi-bin/ - [L,R=403]
        RewriteRule ^uploads/import/ - [L,R=403]
        RewriteRule ^vendor/ - [L,R=403]
    
    
        ####
        # Prevent access to any php script by redirecting the request to /index.php
        # You can add an exception by adding another RewriteCond after this one.
        # Example: RewriteCond %{REQUEST_URI} !^/yourscriptname.php$
        # You can comment out this section if it causes you problems.
        # This is just a nice to have for security purposes.
        ####
        RewriteCond %{REQUEST_URI} !/index.php$
        RewriteRule (.+\.php) [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]
    
    
        ####
        # Redirect any non existing file/directory to /index.php
        ####
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule (.*) index.php [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]
    
    
        ####
        # Add the proper X_REWRITE server variable for rewritten requests.
        ####
        RewriteCond %{ENV:REDIRECT_X_REWRITE} .+
        RewriteCond %{ENV:REDIRECT_X_PATH_INFO} (.+)
        RewriteRule ^index\.php - [E=X_REWRITE:1,E=!REDIRECT_X_REWRITE,E=X_PATH_INFO:%1,E=!REDIRECT_X_PATH_INFO,L]
    </IfModule>
    
    
    <IfModule mod_headers.c>
       <FilesMatch "(?<!embed)\.(css|js|woff|ttf|eot|svg|png|gif|jpeg|jpg|ico|swf)$">
          Header set Cache-Control "max-age=315360000"
          Header set Expires "31 December 2037 23:59:59 GMT"
       </FilesMatch>
    </IfModule>
    


    Kind Regards

  • R_JR_J Ex-Fanboy Munich Admin


    .htaccess files are not handles by nginx. Read that section of the docs and try to find out how to change your server configuration file

  • That's what I was thinking.

    I'll try to convert the .htacess rules to nginx by a converter and see if that works.

    I'm a newbie, so this is what I can do for now 😀

    Thanks for your answer.

    Off topic- this forum is hanging very badly, I can't write anything after 3-4 lines, the page becomes unresponsive for several minutes.

    I'm browsing on google chrome.

    Works fine on my own forum 👍️

    Sorry for posting off topic comment.


Sign In or Register to comment.