pr: [Nightly Fix] - Bug - Fix Alternate Row Color Guard#2
pr: [Nightly Fix] - Bug - Fix Alternate Row Color Guard#2jewel-claw wants to merge 1 commit intomasterfrom
Conversation
|
PR author is not in the allowed authors list. |
Review Summary by QodoFix alternate row color guard checking wrong variable
WalkthroughsDescription• Fixed alternate row color condition checking wrong variable • Changed from checking $css_prefix string to $colors array • Prevents invalid offset warnings on PHP 8 • Restores zebra striping functionality with saved settings Diagramflowchart LR
A["Incorrect: css_prefix string"] -->|Bug| B["Invalid offset warning"]
C["Correct: colors array"] -->|Fix| D["Proper zebra striping"]
File Changes1. app/Views/public/ninja-footable-css.php
|
Code Review by Qodo
1. $colors offset on false
|
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
Change AnalysisThe fix correctly changes
The fix is consistent with the rest of the file where all color settings correctly use the |
| } | ||
| <?php endif; ?> | ||
| <?php if(isset($css_prefix['alternate_color_status']) && $css_prefix['alternate_color_status'] == 'yes'): ?> | ||
| <?php if(isset($colors['alternate_color_status']) && $colors['alternate_color_status'] == 'yes'): ?> |
There was a problem hiding this comment.
1. $colors offset on false 🐞 Bug ⛯ Reliability
In ninja-footable-css.php the stackable zebra-striping condition accesses $colors['alternate_color_status'] even when $colors can be boolean false, which can trigger PHP warnings during CSS generation for stackable tables without custom colors enabled.
Agent Prompt
### Issue description
The stackable-table zebra-striping guard evaluates `$colors['alternate_color_status']` outside the stackable section’s `if ($colors)` guard. Since `$colors` is initialized to `false` unless custom colors are enabled, this can lead to array-offset-on-bool warnings during CSS generation.
### Issue Context
`$hasStackable` can be enabled independently of custom colors. The CSS view is included even when `$colors` is false (e.g., when fonts/custom_css exist). The stackable section should only read `$colors[...]` when `$colors` is an array.
### Fix Focus Areas
- app/Views/public/ninja-footable-css.php[180-236]
- app/Views/public/ninja-footable-css.php[221-236]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
What
Why
alternate_color_statuson$css_prefix, which is a selector string, not the colors arrayFix
alternate_color_statusfrom$colors, which is the actual settings array used by the surrounding templateConfidence
app/Views/public/ninja-footable-css.phpwithphp -l