Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Fatal errors with "addTab" extensions

edited August 2007 in Vanilla 1.0 Help
Using Vanilla 1.1.2, it seems that certain extensions that include an "addTab' command will return a fatal error if a user clicks on the "Sign Out" function of Vanilla. I have tested this with two extensions, "Members Page" and "Private Messages." If either or both of these is enabled, a fatal error is returned after clicking "Sign Out" referencing a line in their default.php file with an "addTab" command. If both are disabled, the Vanilla software functions properly. I have made sure I am using the latest versions of the extensions and I have read all the tips on the community forum discussing these two extensions.

Please let me know if anyone has an idea what I can try. I'd really like to have the functionality of these extensions but I also would like for members to be able to sign out of the forum Is perhaps a reinstall of Vanilla necessary? Thanks.

Comments

  • Likely what is happening is that those extensions are trying to add the tab when the menu object doesn't exist (on every register, sign-out, sign-in etc. page).

    The best way to fix would be to check for existence of the menu object and skip over all the extension's code if it doesn't exist:<?php // All standard extension headers here (author, version, url, etc.) if (isset($Menu)) { // Actual extension code goes here } // Normal end of extension line follows ?>
  • Thank you I will give it a try and report back. I appreciate your time!
  • edited August 2007
    Ah drat. I added your if statement and enclosed the functional parts of both extensions in brackets, but no luck. Not knowing anything about programming php I'll ask what may be a dumb question: does the if statement need closure (like an endif) or is that accomplished by the brackets?

    Thanks again and if anyone has additional thoughts I am open to give it a try. For now I've just advised our users simply to not click "sign out."
  • Yah, the closure is the end curly brace just above "// Normal end of ext"... all existing code should be inserted above that, with the exception of the ?>
  • .. and exception of the comments block at the top. I guess to make it simpler, just add the IF line before the existing code starts and the } line before the existing code ends. Everything else should remain the same
  • Yes, that's exactly what I did but unfortunately it didn't change the behavior. Hmm. I assume this is not happening to everyone else using these extensions so it must be something unique to my installation. I will try to disable everything else and see if they do this all by themselves. Could be some hidden incompatibility I suppose.

    Thanks again.
  • I took a look, and both extensions already check for this before working with the menu--so there may be something else setting the $Menu variable or mucking with the isset() function...

    You could try returning the extensions back to their factory default code, then wherever you find isset($Menu) inside the code, replace it with ($Context->SelfUrl != 'people.php') which literally changes 'Do this if $Menu exists' to 'Don't do this on the people pages'.
  • OK, I got it to work. I am not sure why, but here's what I did. I disabled all extensions and tested Vanilla with no add-ons. All was well. Then I enabled Memberspage by itself, and it worked. Hmm, must be a conflict with something else, I thought, so I enabled Private Message next since it was the other that had given me fatal errors. It worked as well, and the two worked together. OK, something else, so I went through the list of extensions adding them back in one by one, each time testing the Sign Out function. Low and behold I got all my desired extensions back on and everything functions. Is it possible the order of enabling the extensions is important?

    In any case, I am a happy camper for now as everything is working perfectly. My fingers will remain crossed, however.

    Thank you WallPhone for your assistance - and for your extensions. I am using your Duplicate Email checker and it is very helpful.
  • Yes, the order of enabling is important--it determines partially in what order that the extensions will execute. Handy to do things like change the order of links that appear in the comment header--or order of links in the panel, assuming they have the same weight. It never dawned on me that a conflict could be resovled this way--perhaps that is something we should start suggesting when troubleshooting.
  • You said: It never dawned on me that a conflict could be resolved this way--perhaps that is something we should start suggesting when troubleshooting.

    Wow, I am very happy if my issues might help make things easier for this community in some small way. Thanks for that!
This discussion has been closed.