Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Getgrav Core 2.0.11: broke data-options@

Started by Duc 1 month ago · 1 replies · 325 views
1 month ago

I have updated to 2.0.11 core and my contact form select does not display the list of countries. Downgrade back to 2.0.10, the list displays as before.

My partial php function:

JS
public static function countryList()
{
    Return [
      'Afghanistan' => 'Afghanistan',
      'Albania' => 'Albania',
      'Algeria' => 'Algeria',
      'Zimbabwe' => 'Zimbabwe'
    ];
}

my partial contact.md

YAML
country:
  label: false
  type: select
  outerclasses: 'col-6 col-12-small'
  classes: null
  placeholder: Country
  selectize:
    create: true
  data-options@:
    - '\Grav\Theme\mytheme_child::countryList'
  validate:
    required: true
1 month ago

@duceduc, I can reproduce your findings.

A few thoughts:

  • The field option data-*@ is only mentioned in the docs in section Blueprints and not in Frontend Forms.
    It might have never been the intention to use it in frontend forms and you're just using an undocumented feature.
  • Although Frontend Forms are also blueprints, their execution environment is different: Admin vs. Frontend, which imply different security risks.
  • Although data-*@ was working in Grav 2.0.10, a lot of security tightning has been happening on Grav 2.0 and security is still being tightend with every point release.

These are just some thoughts. You might want to create an issue at https://github.com/getgrav/grav/issues

Suggested topics

Topic Participants Replies Views Activity
Support · by Paul Hodges, 4 weeks ago
19 483 5 days ago
Support · by Lauw, 7 days ago
2 99 6 days ago
Support · by Anna, 2 weeks ago
4 426 1 week ago
Support · by gtx, 4 weeks ago
4 377 3 weeks ago
Support · by Anna, 1 month ago
9 483 3 weeks ago