- Issue created by @rhovland
- 🇺🇸United States rhovland Oregon
Feature done. Needs the schema updated and an update hook written to migrate setting "show_overview_link" to "link_display" = "overview"
- 🇮🇳India chhavi.sharma
Hi @rhovland,
You are saying that the feature is done but when I selected stars option in view display and selected shorthand link option.
It is not showing any stars, just a link of all reviews with the reviews count.
So can you please clarify what has been accomplished and what is needed to be done here? - 🇺🇸United States rhovland Oregon
Apologies I had opened this issue to push my code and fell asleep before I finished. I pushed them in the morning. The actual feature this issue is for is done. The only thing remaining to do was the update hook so that existing site configuration is migrated over to the new structure. Also I had not made any changes to the configuration schema file yet which needs to be updated to reflect the changes in configuration.
If the stars aren't displaying then that means the rateit library isn't loading. It's displaying like this on my dev site
- 🇺🇸United States rhovland Oregon
Missed a line of code where $rating_element was being set. Link now properly generates.
Still wouldn't explain your problem of stars not showing up since the old code was still creating the rating element. Think it's probably the javascript library missing.
- 🇮🇳India chhavi.sharma
The update_hook has been implemented and schema has been updated. The issue needs review.
- Status changed to Needs work
29 days ago 9:57pm 16 June 2025 - 🇺🇸United States rhovland Oregon
The update hook does not work. The configuration is not changed and the old configuration remains after it is ran.
- 🇦🇹Austria agoradesign
It cannot work imho, because there are no configs with "commerce_product_review_overall_rating_stars" in its name.
I believe, the correct way to update field formatter settings, is to first identify the field instances it may concern (we have it as base field on commerce_product entity, but maybe we should search potentially available additional fields in other fieldable entities, as the data model does not restrict its usage (if this was ever used and tested at all, is a different question)).
When we have every concerning field instances, go through all configured entity view display configurations of that entity, and check, if this field component is enabled at all. If so, do the change and save it. - 🇺🇸United States rhovland Oregon
Yeah there will never be a
field.formatter.commerce_product_review_overall_rating_stars
because that's only used for fields added to an entity. And the display settings are not stored there.They're stored in the
core.entity_view_display.{entity_name}.default.default
, in this casecore.entity_view_display.commerce_product.default.default.yml
for a default install. If there are other product types or product view modes there will be additional places to update the configuration.While it's technically possible to add this overall rating field type to other entities, they will not work because the all of the field code expects there to be a product entity. We probably should add checks for that to prevent broken config forms if admins accidentally add it to other entities in a separate issue. There doesn't seem to be a way to restrict fields to certain entity types.
- 🇺🇸United States rhovland Oregon
Ok I think this is good to go, just need to review the changes again on monday with a fresh set of eyes
-
rhovland →
committed 341fa108 on 2.x authored by
chhavi.sharma →
Issue #3515935 by rhovland, chhavi.sharma, agoradesign: Option to...
-
rhovland →
committed 341fa108 on 2.x authored by
chhavi.sharma →
Automatically closed - issue fixed for 2 weeks with no activity.