backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 39 forks source link

[META][BC] Add wrapper functions for missing drupal_* functions #3381

Open klonos opened 5 years ago

klonos commented 5 years ago

...I was looking for a respective _backdrop_get_filename_fallback() function in bootstrap.inc, and a wrapper function for it in drupal.inc, but neither exist. Any specific reasons for this?

These Should probably have a wrapper added:

N/A IP Address Blacklisting (Removed in Backdrop):

N/A Code related to the old class registry (Removed in Backdrop):

N/A Private functions (nothing in contrib should call these, safe to change or delete)


PR by @klonos: https://github.com/backdrop/backdrop/pull/2383

klonos commented 5 years ago

I have filed a PR that adds some of these missing wrapper functions, and I have ticked them in the issue summary. I believe that this will improve our backwards compatibility layer.

Still not sure if these were missed or intentionally not included.

quicksketch commented 5 years ago

Any function that starts with an underscore (such as _drupal_get_filename_fallback()) is considered to be a "private" function and can change its arguments or name at any time, because it's not supposed to be used outside of the module that provided it. For that reason, we didn't bother including backwards compatibility for those functions, because they're not intended to be used by any other code.

Other functions we should provide wrappers for if they still have analogues in Backdrop, but some of them no longer have purpose/meaning, such as registry_rebuild() (Backdrop no longer has a database registry).

quicksketch commented 5 years ago

Code related to the old class registry (removed in Backdrop): _drupal_file_scan_cache() _drupal_get_filename_perform_file_scan() _drupal_get_filename_fallback_trigger_error() _drupal_trigger_error_with_delayed_logging() drupal_file_scan_write_cache() drupal_autoload_trait() _registry_check_code() registry_rebuild() registry_update()

IP Address Blacklisting (Removed in Backdrop): drupal_is_denied() drupal_block_denied()

Private functions: _drupal_set_preferred_header_name() _drupal_bootstrap_database() _drupal_bootstrap_variables() _drupal_bootstrap_page_header() _drupal_shutdown_function()

Should probably have a wrapper added:

drupal_is_https() drupal_language_types() drupal_multilingual() language_types() drupal_check_memory_limit() drupal_clear_opcode_cache()

jenlampton commented 5 years ago

Removing milestone, adding tag for milestone review

LeeteqXV commented 4 years ago

In order to easily get the D7 Yubikey module to fully work in BD, the drupal_is_denied function is needed. Please include it so that we can have sites that allow Yubikey-only login (no user name or password). The rest of that module seems to work as long as the deprecated "authmap" table is manually added (empty).

jenlampton commented 3 years ago

I've updated the Original Post with the feedback from @quicksketch to note only the functions we still need to wrap. It looks like maybe only language_types() is missing from the PR by @klonos. We inherited that change from early Drupal 8, and the change record for it is here: https://www.drupal.org/node/1450154

drupal_is_denied() Checks to see if an IP address has been blocked.

@LeeteqXV what should the drupal_is_denied() / backdrop_is_denied() functions do in Backdrop, since there is no list of blocked IP addresses to check?

klonos commented 2 years ago

Still keen to wrap this up. I wanted to ask: should we still add deprecation wrapper functions for things like registry_rebuild()/registry_update() even if it is just to call watchdog_deprecated_function() (so to let people know what's going on and add links to change records etc.)?

jenlampton commented 2 years ago

@klonos I think so, yes. That will help developers find any problems with their code.