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.
Updated: Comment 0
Problem/Motivation
The ModuleInfo was introduced to safe unnessary lookups/info file parsing.
Proposed resolution
Remaining tasks
User interface changes
API changes
Original report by @username
- The main reason this was introduces is *gone* (the stylesheet/js stuff on module .info files)
- There are just two backend places that use it right now, search settings and settings of a specific handler
- There are a few places that could use it, but none seem very relevant to performance: user_admin_permissions(), Permissions::getValueOptions(), Permission::buildOptionsForm(), LayoutController::layoutPageList() (I assume this isn't used now, but could be?), field_help()
Comment | File | Size | Author |
---|---|---|---|
#11 | 2025779-11.patch | 3.64 KB | ianthomas_uk |
Comments
Comment #1
BerdirFixing component.
Comment #2
BerdirOk, I'm confused.
There are exactly two places left in core that use system_get_module_info(). Did we replace that with the module handler? If we did, then did we introduce a regression?
Patch converts it to cache collector but doesn't make it a service yet.
Comment #3
BerdirSo... discussed this with @katbailey and @dawehner a bit.
- The main reason this was introduces is *gone* (the stylesheet/js stuff on module .info files)
- There are just two backend places that use it right now, search settings and settings of a specific handler
- There are a few places that could use it, but none seem very relevant to performance: user_admin_permissions(), Permissions::getValueOptions(), Permission::buildOptionsForm(), LayoutController::layoutPageList() (I assume this isn't used now, but could be?), field_help()
So... should we convert it to a service or just kill it, and switch to system_get_info() in these two places (all this stuff should so much be services, oh well...)
Assigning to @catch for feedback, hope that's ok :)
Comment #4
catchI'd say just kill it.
Comment #5
BerdirThis kills it completely. An alternative would be to keep the helper function but directly access system_get_info() in there?
Comment #7
Berdir#5: module-info-2025779-5.patch queued for re-testing.
Comment #8
BerdirDoesn't need to be assigned to catch.
Comment #9
BerdirComment #10
catchWhen removing this we might still want a persistent cache for system_get_info(). I'd forgotten about this issue when looking at #2060859: Make Block plugin's "category" a translatable string but that's an example where it's getting the info and doesn't need a full rebuild.
Comment #11
ianthomas_ukReroll and update some documentation that used this function as an example.
Comment #12
BerdirHm, did a merge conflict go wrong here? This seems to be adding a new function, which doesn't make sense?
Comment #13
ianthomas_ukThat's a comment that gives an example of when it is acceptable to use a static variable. The previous example is
system_get_module_info()
which won't exist after this patch, so I've replaced it withdrupal_session_started()
.Comment #14
dawehnerComment #15
dawehnerUpdated the issue summary to copy the reasons to remove it.
Good catch ianthomas_uk!
Comment #16
sunAdding to new meta.
Comment #17
sunCan we move forward here? :)
Committing this allows me to remove 2-3 unnecessary items from the overly lengthy "inventory" list in #2186491: [meta] D8 Extension System: Discovery/Listing/Info...
Comment #18
catchCommitted/pushed to 8.x, thanks!
Comment #19
BerdirDo we need a short change notice for this?
Comment #20
BerdirCreated https://drupal.org/node/2188305