forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: flar on April 28, 2006, 10:10:07 am

Title: Fixing missing index inactive_[prev,next]_tab notices
Post by: flar on April 28, 2006, 10:10:07 am
I recently turned on debug mode and notices and saw a few errors about missing inactive_*_tab indices.  They look like they are harmless, but I decided to fix them anyway since the fix was simple and got rid of some "noise" in the debug output.

It looks like there are 3 locations where these values are used as indices into an array but the entries are never created in any array anywhere (that I could find by searching).  They may be obsolete entries for a feature which is now gone and maybe these lines can be deleted, but I decided to just put tests around them to only make the string substitutions if they are set in the array.  This made the notices go away and the code is still there in case some other themes may use this feature.

In include/themes.inc.php, find these 2 lines in 3 places (NOTE that the text <some LINK substitutions> varies by location):
Code: [Select]
    $theme_alb_list_tab_tmpl['inactive_next_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_next_tab'], <some LINK substitutions>);
    $theme_alb_list_tab_tmpl['inactive_prev_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_prev_tab'], <some LINK substitutions>);
and put the following tests around the lines (preserve the original lines above where you see <Same text as the line above> here):
Code: [Select]
    if (isset($theme_thumb_tab_tmpl['inactive_next_tab'])) {
        <Same text as first line above>
    }
    if (isset($theme_thumb_tab_tmpl['inactive_prev_tab'])) {
        <Same text as second line above>
    }

Some of the themes may have similar code (I also found these lines in the sample theme) and so may need the same tests inserted in them, especially if you based a theme off of the sample theme.
Title: Re: Fixing missing index inactive_[prev,next]_tab notices
Post by: Paver on May 18, 2006, 01:42:21 am
I meant to look into this some day and now I have.  Thanks for your comments, flar.

Instead of your suggestion, I added in the two missing entries to $template_tab_display and wrote some placeholder code to process these entries in create_tabs() which is in functions.inc.php.  I left implementing this code to the devel branch since it will change the look of the tabs and didn't want to add a new feature to the 1.4.x series.

I committed my changes to the stable & devel branch as a fix for the errant notices.  I put the code implementation on the to-do list for 1.5.