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.
Options

Yaga's EditContentTimeout perk not defaulting to "Default"

First off, I want to say that yaga is an excellent addition to Vanilla. Very powerful piece of software. Nice work.

I ran into a problem after adding some ranks that stem from the fact that the EditContentTimeout perk option box does not default to "Default". The default option is actually 0, which is deny all editing. So for example, when the admin user earns a rank, yaga overrides Garden.EditContentTimeout and sets it to 0, even if that admin user is trying to set the original config option in the vanilla dashboard. The result is that Garden.EditContentTimeout can never be set to anything other than 0.

I just moved the "Default" option first before the rest of the options. This solved the problem.

--- library/functions.render.php
+++ library/functions.render.php
@@ -141,7 +141,7 @@
       );
     }
     // Add a default option
-    $Options = $Options + array('' => T('Default'));
+    $Options = array('' => T('Default')) + $Options;
     $Form = Gdn::Controller()->Form;
     $Fieldname = 'Conf' . $Config;

Comments

  • Options
    hgtonighthgtonight ∞ · New MVP

    Thanks for trying my addon!

    I will create an issue over on GitHub to track this issue(#91) to make sure a fix gets in a new release.

    Would you mind sharing some basic information regarding your server set up? I am looking for what server software you are running, what version of PHP, Yaga, Vanilla, etc.

    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.

  • Options

    Thanks. Wasn't sure where the appropriate place was to post bug reports was.

    I am running on linux with nginx, PHP 5.6.9 (w/php-fpm), Vanilla 2.1.10, Yaga 1.0.3. I actually run two instances of Vanilla (free and paid) on the same system integrated into a single Drupal 7 site. About 120,000 forum comments and 6000 users.

  • Options
    hgtonighthgtonight ∞ · New MVP

    I believe this is now fixed.

    Dumb thing to overload a binary operator that implies no importance of order to something that does. 1 + 2 = 3 and 2 + 1 = 3, but [2] + [1] = [2] and [1] + [2] = [1].

    /sigh

    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.

  • Options

    Thanks for reporting it and fixing it, @bfcam and @hgtonight.

    I just installed Yaga on my website this morning and noticed this issue as well, but coincidentally, you came out with a new commit on the same day. :D

    Add Pages to Vanilla with the Basic Pages app

Sign In or Register to comment.