Rewrite language_negotiation_include to support form_state and use it in language.admin.inc

Created on 28 March 2012, over 12 years ago
Updated 24 February 2023, over 1 year ago

Coming from #1468930: Clean up and move the code for the negotiation functionality from locale module to language module

+++ b/core/modules/language/language.admin.inc
@@ -436,3 +442,375 @@ function language_admin_predefined_list() {
+function language_negotiation_configure_url_form($form, &$form_state) {
...
+  language_negotiation_include();
None of these form constructor functions should include support files directly. Form functions always have to use form_load_include().

This bug existed before already, so no need to fix it in this monster. However, please create a follow-up issue for that. (this fix can/should be backported)

+++ b/core/modules/language/language.module
@@ -211,3 +259,281 @@ function language_css_alter(&$css) {
+function language_negotiation_include() {
...
+  include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'language') . '/language.negotiation.inc';
Why isn't this using module_load_include()?

Speaking of, you could add an optional &$form_state = NULL parameter to this helper function, so you can also call this function from form constructors. However, we can do that in a follow-up issue (as mentioned above).
📌 Task
Status

Closed: outdated

Version

9.5

Component
Language system 

Last updated 1 day ago

  • Maintained by
  • 🇩🇪Germany @sun
Created by

🇩🇪Germany dawehner

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