Problem/Motivation
Rating field is not showing up on page display. Module installed fine, I've added Rating field to content type with default settings but field is not showing up on page display. Using default Olivero theme without any modifications.
Inspecting with Devel Theme registry doesn't show any relation to the field. Looks like theme doesn't even register the new field.
Steps to reproduce
Install module, add field to the content type, view the node.
Proposed resolution
Make sure that the field shows up on the node display.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork starry_rating-3519260
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
abarrioHi @perke, I followed the steps and field is appearing for me.
Please, can you provide more information about your env?
Anyway, have you tried clearing cache?
Comment #3
perkeHey @abarrio,
Sure, here it is:
Drupal 11.6
PHP 8.3.17
MariaDB 10.11.11
running localy on DDEV v1.24.3
I have theme registry rebuilding on each page load, cache is disabled, twig debugging is on. I've tried both with default theme and with Artisan subtheme with layout builder but no luck. Layout builder see the field and I can add it to the layout but it just doesn't show up.
Hope this helps!
Comment #5
abarrioCreated a fix for this issue.
Just added a default plugins for formatter and widget.
@perke can you take a look on it?
Comment #6
perkeHey @abarrio, thanks for your work on this!
After some meddling, I've managed to get stars to display but they're not clickable, for some reason.
Here's what I did:
applied patch, all went ok - issue still present
turn off all twig debugging/caching - issue still there
removed all Rating fields and reinstalled module/restarted ddev - issue still there
Added new Rating field with different machine_name and was able to see it on the node/edit page, where the stars are clickable. Guess this could've been a issue as I previously had a field from Fivestar module with the same field name.
Only when I manually re-saved content, I was able to see the field but the stars are not clickable. There are no related errors in console, except the debug from console.dir(starRatingEl); from the star_rating.js
This happens both in default and custom theme, with and without layout builder templates.
Hope this helps to debug further!
Thanks
Comment #7
abarrioHi @perke, probably you had old data from old field which is not compatible with the data that this module generates and this is why it is has not appeared until you create a new field with a different machine name.
I'm going to mark this as resolved and generate a new release version.
Comment #9
abarrioReleased version 1.0.1 version with this fix.
Comment #10
abarrioComment #11
abarrio