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.
Dave reid pointed this in one of my patches yesterday. This patch patches field and file modules which are the only remaining modules containing require(DRUPAL_ROOT ...)
Comment | File | Size | Author |
---|---|---|---|
#12 | 599122_require_drupal_root_file_12.patch | 2.86 KB | scor |
#11 | 599122_require_drupal_root_file_11.patch | 1.95 KB | scor |
#9 | socrappywecantevenuseit3.patch | 1.94 KB | scor |
#8 | socrappywecantevenuseit2.patch | 1.94 KB | scor |
#6 | socrappywecantevenuseit.patch | 1.67 KB | catch |
Comments
Comment #1
catchYes. We have APIs, and even when they're as crappy and confusing as drupal_load() and module_load_include(), we should use them.
Comment #2
webchickYeah, I have to agree I find the old code more readable, but this at least makes it consistent.
Committed to HEAD. Thanks!
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedCalling module_load_include() in a global context is a really bad idea (module_load_include() will fail if called before common.inc is loaded). Let's revert those.
Comment #5
pwolanin CreditAttribution: pwolanin commentedyes, revert please
Comment #6
catchStraight revert attached. The unreliability should be documented in module_load_include(), but I couldn't think of a good way of putting it - maybe something like "only use this in situations where loading another module's include file, where you cannot be sure of the location.".
Comment #8
scor CreditAttribution: scor commentedAdding some documentation to module.inc so this does not happen again.
Comment #9
scor CreditAttribution: scor commentedfix typo
Comment #10
yched CreditAttribution: yched commentedBump. Note that I reuploaded basically the same patch in #685572-3: system_update_7008() is broken.
Meanwhile, modules/field/tests/field_test.module needs to be fixed as well.
Comment #11
scor CreditAttribution: scor commentedrerolling
Comment #12
scor CreditAttribution: scor commentedmerging #685572-3: system_update_7008() is broken into the previous patch #11 (contains fix for field_test.module).
Comment #13
yched CreditAttribution: yched commentedComment #14
catch#685572: system_update_7008() is broken was duplicate, and critical upgrade path bug.
Comment #15
webchickI guess we should look at removing this stupid, confusing, and useless function in Drupal 8.
Thanks, committed to HEAD.
Comment #16
scor CreditAttribution: scor commentedwhere are we keeping track of these things? would that deserve a D7 patch with a @todo? or is there a page/meta-issue for "WTF removal for Drupal 8"?
Comment #17
catchThere's a Drupal 8 version tag, no harm opening one against that.
Comment #18
scor CreditAttribution: scor commentedfollow-up issue for D8 #697946: Properly deprecate module_load_include() and move it into \Drupal::moduleHandler() service