On Drupal 7.x urls with prepopulate values looks well, here is example for field_my_custom_field:
?edit[field_my_custom_field]=My custom text
But on Drupal 8 - they becomes too ugly! Here is example of GET argument key for prepopulate some field_my_custom_field :
?edit[field_my_custom_field][widget][0][value]=My custom text
- it eats 47 symbols from url, and looks very terrible!
And if we want to prepopulate 5 fields - we will got very long url, that even does not fit in browser location field!
Good solution for this problem can be providing short aliases for most of regular fields, so accept something like "field_my_custom_field"
Will be good to allow shorter aliases for long ?edit[field_my_custom_field][widget][0][value]=My custom text
arguments - something like ?edit[field_my_custom_field]=My custom text
, or maybe even ?field_my_custom_field=My custom text
!
For not broke old behavior - we can make this feature optionally, with manually enable in settings - globally, or per form_id.
And on stage, when we parse GET arguments from url, we can add checker of field availability in form for each argument, and if field exists - prepopulate it value.
What do you think about this idea?
Active
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.