• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed b4 js problem in acp

R

ragtek

Guest
#1
As you see the last / is missing....
cachereb.PNG

Possible fix:
Code:
    protected function processJsUrls(array $jsFiles)
    {
        // add version number to each required file
        foreach ($jsFiles AS &$file)
        {
            $file = $file . (strpos($file, '?') ? '&' : '?') . '_v=' . XenForo_Application::$jsVersion;
        }

        // source XenForo JS from 'js/xenforo/x/' if required
        switch (XenForo_Application::get('options')->uncompressedJs)
        {
            case 1:
                $jsFiles = str_replace('js/xenforo/', 'js/xenforo/full/', $jsFiles);
                break;

            case 2:
                $jsFiles = str_replace('js/xenforo', 'js/xenforo/min/', $jsFiles);
                break;
        }

        // handle custom JS URL
        return preg_replace('#^js/#', XenForo_Application::$javaScriptUrl . '/', $jsFiles);
    }
then it's working in the acp, but in the frontend the url is:
bug2.PNG
 
F

Floris

Guest
#8
And, if we already have upgraded, should we re-do it? Or can we just replace a file and rebuild caches somehow?
 

infis

Well-known member
#13
If you see message when appling patch: (Stripping trailing CRs from patch.) - and patch not appling.
You are can install tofrodos (in Debian/Ubuntu - sudo apt-get install tofrodos) and use it as:
Code:
serv:# fromdos changeset_5065.diff
serv:# fromdos Abstract.php
serv:# patch < changeset_5065.diff
serv:# todos Abstract.php
 
F

Floris

Guest
#15
I hope seeing it visual like this perhaps makes more sense:

Screen shot 2011-10-27 at 8.09.42 PM.png

You can either manually find the old code, and replace it with the new code.
Or load the old file in a diff handler and parse it with the .diff that Kier provided.
 
F

Floris

Guest
#20
So rather than not hearing from the developers at all, who just reply (if you're lucky) pointing to "this is beta, we dont' support it) they (within a couple of minutes) provide a patch .. and you whine about it.