Bolt: [BUG] Select values in templatefields are returning their indexes, not values

Created on 30 Jan 2017  Â·  5Comments  Â·  Source: bolt/bolt

It appears that values in templateselect fields are returning their index of the selected value, not the actual value itself.

In theme.yml:

services/fire-extinguishers.twig:
    ticks:
        type: repeater
        label: "Tickmarks"
        fields:
            kind:
                type: select
                values: [blue, grey]
                required: true
            text:
                type: text
                required: true

So selecting blue in the backend will result in 0 when using:

{% for tick in record.templatefields.ticks %}
    {{ tick.get('kind') }}
{% endfor %}

Selecting grey would also result in 1, rather than the value.

Object generated:

object

Details

  • Relevant Bolt Version: 3.2.5
  • Install type: Composer install
  • PHP version: 5.6
  • Used web server: Apache

Reproduction

​1. Create a record and configure theme.yml with the above config.

  1. In the record, create an entry for the repeater and select a value
  2. Create a 2nd entry and choose another value
  3. Observe the record and it's contents, showing a 0 and a 1 respectively as their values
bug

Most helpful comment

Found the problem with this, working on fix.

All 5 comments

Found the problem with this, working on fix.

@rossriley figure it out?

@rossriley Any update on this (and by proxy #6336)

Yes, I need to pull my finger out.... PR coming in the next couple of hours.

Fixed in #6405

Was this page helpful?
0 / 5 - 0 ratings