Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Curious issue with themes - they don't display... but print ' '; anywhere in index.php fixes it

sneurlaxsneurlax New
edited October 2013 in Vanilla 2.0 - 2.8

As the title says, I had trouble getting themes to work at all. Although the CSS stylesheets were being loaded correctly, no themes would apply. Troubleshooting, I decided to make sure that PATH_THEMES was formatted correctly. As I am currently running a webserver locally, it was malformed as X:\path\forum/themes as shown by a print PATH_THEMES in bootstrap.php. BUT that same print used to diagnose the problem fixed it! The malformed path was displayed at the top of the page above a fully-styled forum.

What is going on here? I fiddled around and any print (even ' ') anywhere in bootstrap.php or index.php alleviates the problem. If I could print that space at the end of the page I would be just fine to leave the fix at that (although there is certainly something very wrong going on here,) but it leaves a newline above any page content, which is undesirable.

Thoughts?

Best Answer

Answers

  • sneurlaxsneurlax New
    edited October 2013

    I would like to note that the forum has displayed the html entity for a space (& nbsp;) as a space, but print ' '; doesn't actually work -- only print '& nbsp;' (without the space between & and n, of course)

    EDIT: One more diagnostic: it must be anywhere before $Dispatcher->Dispatch(); in index.php ... I'm off to Dispatch() to find the end of this rabbit hole.

    EDIT 2: Any print inside of Dispatch() fixes the issue. But I am no closer to finding out why, or how to fix this problem to my satisfaction. An additional note: any string print()ed thusly is also appended to the "Manage Spam" and "Moderation Queue" links in the settings panel as well as being appended to the page.

  • peregrineperegrine MVP
    edited October 2013

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Version 2.0.18.8

    I have not altered any files from the vanilla installation - except, of course, the single addition of the print mentioned above. An echo yields the same result. After a routine installation, I noticed that the theme did not apply and so poked around in the source and decided to check to see if PATH_THEMES was formatted correctly first. It was not. But the mere act of printing it out fixed the problem, albeit with the undesirable side-effect of prepending the string to the page as well as sprinkling it throughout the page. Troubleshooting, any printed string produces the same fix. But that knowledge brings me no more understanding of what the hell is going on that a print/echo can fix it in such a kludgey way.

    Should I post screenshots of before/after?

    On a side note, I noticed that this was the case with PunBB, as well. I have been trying out various forum softwares today in the quest to find a package that will integrate with my current user database with SSO capability. As Vanilla has exactly that capability, I would like to use it but am perplexed by this problem.

  • so you did a fresh install and the default theme did not work?

    or is it a** cache problem** and or page speed or minify problem

    try deleting the ini files in /cache

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • sneurlaxsneurlax New
    edited October 2013

    Yes. Fresh install. Default theme not working.
    INI files in /cache deleted. No result.

    Again, PATH_XXX are all malformed. PATH_ROOT is X:\path_to_webserver\forum and PATH_THEME, for example, is X:\path_to_webserver\forum/themes. I thought that this would be the issue, but a print of any string before or within the Dispatch() function fixes it.

    UPDATE: the CSS Stylesheets are NOT loading properly without the hack mentioned. They show up in CSS>View CSS in Wed Developer toolbar for Firefox, but Firebug confirms that they are not loading without the hack. With any print, though, the stylesheets are loaded. I'll look for the place where stylesheets are loaded and see if I can pinpoint the bug there. Mind pointing me in the right direction while I'm searching for relevant strings within the source?

  • peregrineperegrine MVP
    edited October 2013

    X:\path_to_webserver \ forum / themes.

    forward slash back slash looks weird.

    what Operating system.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • sneurlaxsneurlax New
    edited October 2013

    Windows 7.

    That's exactly what I thought. Malformed path, right?

    But changing all of the slashes in all of the defines in index.php and bootstrap.php to be consistent does not fix the problem.

  • need some windows 7 folks to help. I don't use it.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I discovered that I must change the PATH_THEMES (and PATH_XXX) definitions to \ (or just change DS in index.php) in constants.php to allow the changes to have any effect

    Changing the slashes to all be correct, however, still does not fix the problem. Printing the correct(ed) path, however, still does.

  • @vrijvlinder said:
    You have not said what plugins you have enabled and if you use minify or page speed or anything like that.

    What is happening to you is not common unless you are using a certain plugin as stated above. I would suggest re installing using a fresh database on another subdirectory and compare the two if the new install works.

    I think you are complicating it for yourself no? This software works out of the box almost always and when it does not , it is because of misconfigurations or errors in the installation .

    No plugins are enabled. Absolutely no changes have been made to this installation except the ones mentioned above, and all are in a svn that are rolled back to the original fresh install after every failed troubleshooting.

    I will reinstall in a fresh subdirectory and database right now and check to see what happens. Give me a minute.

  • sneurlaxsneurlax New
    edited October 2013

    This is the strangest solution, but it seems to work - I have to admit that there is no bug in Vanilla, but rather that it is something wonky with my webserver. Any other subdirectory name than /forum works. /forum2, /forums, /forumdebug, etc., all work. I have no idea why this is the case. My .htaccess files aren't an issue (I removed all of them to make sure they were having no impact, even after an apache restart.)

    So thanks for your attempts, but it wasn't any issue with Vanilla after all. I'll have to tinker around on my side and figure out why /forum specifically causes this issue.

    Cheers,
    sneurlax

    ... I can't believe I didn't try moving it to a different subdirectory early on... facepalm

  • x00x00 MVP
    edited October 2013

    It sound like you have some caching issue, or you server

    I don't think it is the directory separator becuase PHP can resolve this.

    grep is your friend.

Sign In or Register to comment.