When attempting to create a view that upcasts a parameter, you get an error when entering anything other than a simple key: value string in the "Options" section of the route. This appears to be the most common purpose of this module -- the example in the README shows a YAML string, but in recent versions of Drupal core, these settings are validated against the schema, and fail.
I get this exception:
InvalidArgumentException: The configuration property display.page_1.display_options.display_extenders.views_advanced_routing_route.route.options.parameters.commerce_product doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get() (line 76 of core/lib/Drupal/Core/Config/Schema/ArrayElement.php).
... when entering this option yaml:
parameters:
commerce_product:
type: 'entity:commerce_product'
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | views_advanced_routing-3102832-2.patch | 555 bytes | freelock |
Comments
Comment #2
freelockI'm not at all sure what the best approach is to creating a schema for arbitrary configs imported like this -- perhaps we should make use of "type: ignore"?
Without doing that, the attached patch appears to work in Drupal 8.8.1, at least to allow saving parameter upcasting options (and also appears to not break simple string options).
Comment #3
freelock(forgot to update status)...
Comment #4
andypostConfirm this bug, patch helps to save the view but config_inspector still complains
For example
no_cache: 'TRUE'optionComment #5
andypostAs there's no way to predict allowed options the `type: ignore` could be solution
\Drupal\views_advanced_routing\Plugin\views\display_extender\AdvancedRouting::validateOptionsForm()also could extend validation to prevent WSODComment #7
dpiCollecting credits from schema issues 1 2
Comment #8
dpiComment #10
dpiAs suggested by #2, the
ignoretype seems to work fine for this purpose.Committed!