Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAPI: Form API Reference check #145

Closed
bugfolder opened this issue Jun 18, 2021 · 1 comment · Fixed by #146
Closed

FAPI: Form API Reference check #145

bugfolder opened this issue Jun 18, 2021 · 1 comment · Fixed by #146

Comments

@bugfolder
Copy link
Contributor

On the Form API Reference page (FAPIR), we have form elements, their properties, and their default values. There is a note at the beginning of the Default Values section that element default values can be found in system_element_info().

In fact, now that several form elements have been moved from contrib into core, there are now many elements whose descriptions are not in system_element_info(), but that come from other invocations of hook_element_info() and hook_element_info_alter(). The collection of those invocations gives all available core form elements and their default values.

There are at present a fair number of discrepancies between what is in core code and what is currently listed in the FAPIR. See, for example:

In addition to missing elements, there are also many discrepancies about default properties.

We can, of course, manually bring the FAPIR into agreement with core, but it would be helpful to have a listing of all discrepancies to work from.

So I have put together an admin page on docs.backdropcms.org that gathers all the information in code, compares it to what's in the db, and displays a listing of things in code that are missing from the db (not yet the reverse). It will be found at path admin/reports/fapi-check once the associated PR is applied.

Currently, making corrections to the db is done manually. This listing of the discrepancies raises the possibility of whether to augment this code to not only flag discrepancies, but auto-correct them, so as to automatically keep the db in sync with what's in code. I think that should probably wait until after some further discussion about possible changes to the FAPIR page (e.g., maybe not listing some properties, etc.). But for now, this report gives a useful indication of the scope of the discrepancy issue to consider and provides a guide for current corrections, and so I would encourage its inclusion now, with the possibility of further changes in the future.

PR to follow.

@bugfolder
Copy link
Contributor Author

Here's an example of the discrepancy listing (which goes on considerably longer than this).

FAPI check

bugfolder added a commit that referenced this issue Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant