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

Command icon 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

perke created an issue. See original summary.

abarrio’s picture

Status: Active » Postponed (maintainer needs more info)

Hi @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?

perke’s picture

Hey @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!

abarrio’s picture

Status: Postponed (maintainer needs more info) » Needs review

Created a fix for this issue.
Just added a default plugins for formatter and widget.

@perke can you take a look on it?

perke’s picture

Hey @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

abarrio’s picture

Status: Needs review » Reviewed & tested by the community

Hi @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.

  • abarrio committed 67694d7d on 1.0.x
    #3519260: Add config for field and default plugins for formatter and...
abarrio’s picture

Status: Reviewed & tested by the community » Fixed

Released version 1.0.1 version with this fix.

abarrio’s picture

abarrio’s picture

Status: Fixed » Closed (fixed)