tokens not being injected properly in Calendar-by-month settings

Created on 26 April 2023, about 1 year ago
Updated 3 May 2023, about 1 year ago

Problem/Motivation

Just beginning learning on this module, and trying out colour-coding events on a calendar by taxonomy.

I thought I had an easy solution, since we can inject a class in the “Calendar by month” -> Settings, where we can add a CSS class to a row with a Replacement Token. I added the existing Taxonomy ID as a field in the view, and then added the token for that ID as part of the class that was getting injected (e.g. event--{{ field_event_category }} ).

What’s happening, though, is that it’s using the same Taxonomy ID token for every event in the month - whichever one appears first in the view. So e.g. I use 58, 59, and 60 for the different Taxonomy IDs, and if 58 happens to be the one for the first event that shows up in the view, all events in the view for the current month get “event--58" added to their li tag class. If the first event in the view has Taxonomy ID, then “event--59” is injected to all events in the view.

I was expecting that the token would grab each view row’s/event’s specific Taxonomy ID and use that for the class for the li tag.

Steps to reproduce

  • Add a Taxonomy ID field to the view.
  • In Format -> Calendar by month | Settings, add the replacement token for that ID field into the "Row class" field.
  • Save the view, view it, inspect it, and the injected class in the li tag will use the Taxonomy ID from the first record in the view for all records in the view instead of each having its own ID from its record.

Proposed resolution

First reported on Slack - @matthieucarset is already aware, has labeled this as a bug, and is active on it. (And big kudos to him for his super-quick responses.)

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇨🇦Canada michaelschutz

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

Comments & Activities

Production build 0.69.0 2024