Unify ajax routes under single entry point

Created on 15 November 2015, about 9 years ago
Updated 15 September 2024, 2 months ago

Currently, many modules that define ajax routes use whatever paths they seem fit. For example: /block-category/autocomplete, /entity_reference_autocomplete/{target_type}/{selection_handler}/{selection_settings_key}, /contextual/render, /editor/{entity_type}/{entity}/{field_name}/{langcode}/{view_mode_id}, and so on.

This can sometimes make code inspection, debugging or DX as a whole unpleasant. Therefore I think that any route that returns response that is not a proper html page response but rather response designated for ajax calls(for example) should be placed to a specific path that would allow easy identification of the type of the response and module that is providing it.

For this reason I think these routes should be placed under /system/ajax/modulename/foobar. I mean this as Drupal code standard(that core would implement), not an absolute state that could be somehow restricted by the core.

✨ Feature request
Status

Closed: works as designed

Version

11.0 πŸ”₯

Component
AjaxΒ  β†’

Last updated 3 days ago

Created by

Live updates comments and jobs are added and updated live.
  • Documentation

    Primarily changes documentation, not code. For Drupal core issues, select the Documentation component instead of using this tag. In general, component selection is preferred over tag selection.

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.

Production build 0.71.5 2024