Ajax API has incomplete example; references obsolete module instead

Created on 12 September 2016, over 8 years ago
Updated 16 February 2023, almost 2 years ago

Problem/Motivation

In the Ajax API documentation, the example references the contrib module config_translation β†’ , which last had a commit in 2013 and is marked as obsolete.

As a result:

* The example form API array won't work on a newly installed Drupal core.
* It doesn't follow usual module folder structure (lib/ rather than src/?)
* DateFormat::ajaxSample still treats $form_state as an array, not a FormStateInterface object.
* More generally, the example won't be receiving any updates in the future.

See e.g. http://cgit.drupalcode.org/config_translation/tree/lib/Drupal/config_tra...

Proposed resolution

Add an example of a callback in the relevant .api.php file in core, and reference this instead. Probably even rearrange the documentation, so the callback is first: that way the #ajax Form API example will work "straight away".

This means the docs can still link out to other examples, but they're not dependent on them being kept up to date.

Remaining tasks

1. Add example to documentation.
2. Review and approve patch.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
DocumentationΒ  β†’

Last updated 2 days ago

No maintainer
Created by

πŸ‡¬πŸ‡§United Kingdom jp.stacey

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.

Production build 0.71.5 2024