joomla-cms
joomla-cms copied to clipboard
[5.1][schemaorg] Value consisting of 0 is removed as empty
Steps to reproduce the issue
When creating a schemaorg plugin for an element containing offers, it is not possible to specify a price value of 0 - it is deleted
Expected result
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }
Actual result
"offers": { "@type": "Offer", "priceCurrency": "USD" }
System information (as much as possible)
Joomla 5.1 Php 8.2
Additional comments
Google allow value 0 for show "Price: free" (https://developers.google.com/search/docs/appearance/structured-data/software-app?hl=en)
Lines causing the error
plugins/system/schemaorg/src/Extension/Schemaorg.php : cleanupSchema
if (empty($value)) { continue; }