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 week ago · 1 replies · 131 views
1 week 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 week 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 Anna, 3 days ago
4 92 8 hours ago
Support · by TomW, 3 days ago
2 74 1 day ago
Support · by Anna, 7 days ago
7 190 2 days ago
Support · by Anna, 6 days ago
9 156 3 days ago
Support · by stuart young, 6 days ago
2 103 5 days ago