Field not showing up

Created on 15 April 2025, 4 months ago

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

🐛 Bug report
Status

Active

Version

1.0

Component

User interface

Created by

🇳🇱Netherlands perke Netherlands

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @perke
  • 🇪🇸Spain abarrio

    Hi @perke, I followed the steps and field is appearing for me.
    Please, can you provide more information about your env?

    Anyhow, have you tried to clear cache?

  • 🇳🇱Netherlands perke Netherlands

    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. 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!

  • 🇪🇸Spain abarrio

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

    @perke can you take a look on it?

  • 🇳🇱Netherlands perke Netherlands

    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

  • 🇪🇸Spain abarrio

    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...
  • 🇪🇸Spain abarrio

    Released version 1.0.1 version with this fix.

Production build 0.71.5 2024