Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid reference to missing panel in root card #8297

Merged
merged 1 commit into from
Apr 7, 2023

Conversation

alexgarel
Copy link
Member

Do not reference contribution_card in root card if not present.

Fixes: #8295

Do not reference contribution_card in root card if not present.

Fixes: #8295
@alexgarel alexgarel requested a review from a team as a code owner April 7, 2023 15:04
@github-actions github-actions bot added API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🧪 integration tests 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. 🧪 tests labels Apr 7, 2023
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@@ -91,7 +91,7 @@ sub create_contribution_card_panel ($product_ref, $target_lc, $target_cc, $optio
"api/knowledge-panels/contribution/contribution_card.tt.json",
$panel_data_ref, $product_ref, $target_lc, $target_cc, $options_ref);
}
return;
return !!@panels;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest return scalar @panels

@stephanegigandet stephanegigandet merged commit acfb092 into main Apr 7, 2023
@stephanegigandet stephanegigandet deleted the fix-contribution-empty-ref branch April 7, 2023 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🧪 integration tests 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. 🧪 tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue on mobile app due to missing panel
2 participants