You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
bugfolder
added a commit
to bugfolder/docs.backdropcms.org
that referenced
this issue
Jun 18, 2021
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 ofhook_element_info()
andhook_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.
The text was updated successfully, but these errors were encountered: