Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6.1 is here with critical security patches. One of them has been publicly disclosed.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Error on discussion with poll

This discussion is related to the Discussion Polls addon.
edited November 2014 in Vanilla 2.0 - 2.3

When I add a poll to a discussion, I get this error:
Fatal error: Call to undefined function WrapIf() in /path/to/vanilla/plugins/DiscussionPolls/class.discussionpolls.plugin.php on line 550

vanilla, with rounder theme.


  • hgtonighthgtonight ∞ · New Moderator

    Oh dear... looks like I used a 2.1 function.

    Please add the following to your /conf/bootstrap-before.php file:

    function WrapIf($String, $Tag = 'span', $Attributes = '') {
       if (empty($String))
          return '';
          return Wrap($String, $Tag, $Attributes);

    If you don't have a /conf/bootstrap-before.php file, create it with the above contents.

    Please note that new versions of my plugins will not be 2.0.x compatible.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Thank you for your help. I had to fiddle around a little bit.

    The filename should be is /conf/bootstrap.before.php, not /conf/bootstrap-before.php.

    I have no clue about PHP, so first I missed something at the beginning of the file. Now it looks like this (and everything works):

         <?php if (!defined('APPLICATION')) exit();
            function WrapIf($String, $Tag = 'span', $Attributes = '') {
            if (empty($String))
            return '';
            return Wrap($String, $Tag, $Attributes);

    Thank you again!

Sign In or Register to comment.