Add shorter aliases for current long GET arguments in url

Created on 5 October 2020, over 3 years ago
Updated 20 January 2023, over 1 year ago

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?

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡²Armenia Murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.69.0 2024