Results 1 to 5 of 5

Thread: A Little Bug in 0.8.2 Stable

  1. #1
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default A Little Bug in 0.8.2 Stable

    I installed the newest version of Gallery yesterday (0.8.2 build 14).

    I believe I've found a little bug. It occurs in the compile() methods of ModuleGalleryList.php and ModuleGalleryListPage.php. where you are setting up the filter options. It checks the options_callback to build filter values. But it references a variable "$id" which isn't defined. So custom filters that use an options_callback don't appear at all in the module.

    It occurs on:

    1. ModuleGalleryList.php (lines 126 & 130)
    2. ModuleGalleryListPage.php (lines 148 & 152)

    My first thought was it should be "$v" instead -- but not 100% sure.

    Thanks! Great extension!
    Brian

  2. #2
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: A Little Bug in 0.8.2 Stable

    Thanks for that. I’m not quite sure what $id was supposed to be, as normally you just check the options callback array. Then I have changed it so that it passes the $this object to the callback, which I’m not sure is 100% correct.

  3. #3
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: A Little Bug in 0.8.2 Stable

    Thanks! The repository wasn't working for me yesterday, so I just now updated.

    I've since changed my implementation (for unrelated reasons), so I don't have anything setup to do a quick test for this, but I was digging through the code and it looks like the options_callback normally passes a DataContainer object, whereas in your case with $this you'd be passing Module objects.

    I wasn't using what was passed into my callback function anyway, so it didn't matter, but it might be an issue for someone else down the road. Just want to give a heads up.

    Thanks again.
    Brian

  4. #4
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: A Little Bug in 0.8.2 Stable

    I know. The problem lies in the fact that in the BE the DataContainer is the DC_Table and contains the current record, and that may not be valid in the FE, so I’ts up to the callback to determine if it’s in BE or FE mode. I can’t instantiate the DataContainer in the FE (loadDataContainer doesn’t make a DataContainer), so the best I can to is to pass the module instead, as it has access to the data.

    Anyone have a suggestion?

  5. #5
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: A Little Bug in 0.8.2 Stable

    Ahh -- I see. That makes sense.

    So for future reference, I should just check TL_MODE in my callback -- then I'll know what type of object I'm getting before doing what I need to do... Thanks!
    Brian

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •