Problem/Motivation
I was reading around code when found this @todo in system.module:
Remove $type argument, obsolete with $module->getType()
Proposed resolution
Actually do what the todo says !
Remaining tasks
- Implement patch
- Test & Review
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | remove_type_argument-2534100-16.patch | 1.59 KB | alvar0hurtad0 |
| #16 | interdiff.txt | 523 bytes | alvar0hurtad0 |
| #10 | 2534100-10.patch | 1.59 KB | sdstyles |
| #4 | 2534100-4.patch | 1.59 KB | miteshmap |
| #2 | 2534100-2.patch | 1.44 KB | joshi.rohit100 |
Comments
Comment #1
dom. commentedPatch attached.
Comment #2
joshi.rohit100As per the todo, it is fine. However, I am not seeing any benefit (except getting type dynamically) of calling
$module->getType() as it will always return the 'module'.
see this -
$modules = $listing->scan('module');.It is only getting the list of modules. So I think, instead of calling another method (getType()) or setting a variable ($type), why don't we directly set the hardcoded value as below
\Drupal::moduleHandler()->alter('system_info', $modules[$key]->info, $modules[$key], 'module');Otherwise, I think, we should make dynamic from this -
$modules = $listing->scan($extension_type);where $extension_type is method paramater with default to 'module'.Attaching a path for reference.
Comment #3
nitebreedReviewing this one at DrupalCon Barcelona.
Since the variable is called $extension_type, the PHPDoc should also contain this.
Rest of the patch seems to work fine though.
Comment #4
miteshmapAgree with @joshi.rohit100. Updated the variable name in PHPDoc. Also removed the variable
$typeas it seems unnecessary, as we are not using that variable again, so, we can simply pass the$module->getType()to the function argument.Comment #5
miteshmapComment #8
isntall commentedThe patch from comment 4 broke a qa.d.o testbot.
It has been cancelled.
Comment #10
sdstyles commentedRe-rolled it.
Comment #11
dawehnerAre you sure that this function is used at all for themes? I'm pretty sure that
\Drupal\Core\Extension\ThemeHandler::refreshInfoand\Drupal\Core\Extension\ThemeHandler::rebuildThemeDatacares about it ...Comment #14
isntall commentedPatch #10 had the same effect at patch #4
Running tests, 2,195,650 assertion(s)That is about 21x the normal number of assertions.
It has also been cancelled.
Comment #16
alvar0hurtad0The patch rerolled and with an issue about documentation fixed
Comment #17
isntall commentedAnd again, #16 is having the same effect on on the qa.d.o and DCI testbots.
Both are being cancelled.
Comment #19
isntall commentedComment #22
alvar0hurtad0@isntall, any idea about why?
Comment #27
blackra commentedI am removing the Novice and php-novice tags from this issue because working out why a patch is killing testbots is not a problem we should be assigning to novices.
Comment #41
quietone commentedThanks for the work here to improve Drupal. My research shows that this was fixed in #2659940: Extension System, Part III: ThemeExtensionList and ThemeEngineExtensionList.