Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
During our simpletest run, there are PHP notices about context query string condition.
$ ... simpletest
Notice: Undefined index: QUERY_STRING in
/.../modules/contrib/context/plugins/context_condition_query_string.inc on line 19 #0 /.../docroot/includes/bootstrap.inc(2591): _drupal_error_handler_real(8, 'Undefined index...', '/...', 19, Array)
#1 /.../modules/contrib/context/plugins/context_condition_query_string.inc(19): _drupal_error_handler(8, 'Undefined index...', '/...', 19, Array)
#2 /.../modules/contrib/context/context.module(175): context_condition_query_string->execute()
#3 /.../docroot/includes/module.inc(957): context_init()
#4 /.../docroot/includes/common.inc(5310): module_invoke_all('init')
#5 /.../docroot/includes/bootstrap.inc(2538): _drupal_bootstrap_full()
#6 /.../docroot/scripts/...: drupal_bootstrap(7)
#7 {main}
Proposed resolution
Patch attached which sets the value to check against to an empty string if $_SERVER['QUERY_STRING'] is empty.
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#2 | context-fix_query_string_condition_php_notice-2917541-0-D7.patch | 737 bytes | zeyus |
|
Comments
Comment #2
zeyus CreditAttribution: zeyus commentedComment #4
nedjoComment #5
nedjoApplied, thanks!