Remember me? forgot password | register

SilverStripe Forum

4683 Posts in 1048 Topics by 664 members

Jump to:

Extending and hacking

If this is your first visit, you will need to register before you can post. However, you can browse all messages below.

Community » SilverStripe Forum » Extending and hacking » temp fix for if Odd bug
Page: 1 go to end Reply
Author Topic: temp fix for if Odd bug 478 views
  • dashiel
    dashiel's avatar
    Community Member
    13 posts

    temp fix for if Odd bug Link to this post

    i noticed there was a 3-month old, low priority ticket for the if Odd failing. i came up with what is probably a dirty hack, but basically i changed:

    line 647 in VariableData.php from


    function Odd() {
       return !$this->iteratorPos % 2;
    }

    to


    function Odd() {
       return !$this->Even();
    }

    it seems to work, and so far hasn't caused any weird spikes in performance. hope this helps those of you in need of a quick fix, until someone who knows PHP can fix it properly.

  • Sam
    avatar
    Core Development Team
    482 posts

    Re: temp fix for if Odd bug Link to this post

    That fix looks good; can you post it to open.silverstripe.com so that we can integrate it with the core? :-)

  • dashiel
    dashiel's avatar
    Community Member
    13 posts

    Re: temp fix for if Odd bug Link to this post

    i just uploaded to open.silverstripe.com - i added the file to the original trouble ticket. not sure if that's the right way to do it.

    478 views
go to top Reply

Currently Online:

mapes911, François, janulka, Matt Hardwick, simon_w, motoservo

Welcome to our latest member: patrics