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

Comments

dom.’s picture

Status: Active » Needs review
Issue tags: +Novice, +php-novice
StatusFileSize
new627 bytes

Patch attached.

joshi.rohit100’s picture

StatusFileSize
new1.44 KB

As 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.

nitebreed’s picture

Status: Needs review » Needs work
+++ b/core/modules/system/system.module
@@ -916,10 +916,13 @@ function system_get_info($type, $name = NULL) {
+ * @param $type

Reviewing 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.

miteshmap’s picture

StatusFileSize
new1.59 KB

Agree with @joshi.rohit100. Updated the variable name in PHPDoc. Also removed the variable $type as it seems unnecessary, as we are not using that variable again, so, we can simply pass the $module->getType() to the function argument.

miteshmap’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: 2534100-4.patch, failed testing.

The last submitted patch, 4: 2534100-4.patch, failed testing.

isntall’s picture

The patch from comment 4 broke a qa.d.o testbot.
It has been cancelled.

Status: Needs work » Needs review

sdstyles queued 4: 2534100-4.patch for re-testing.

sdstyles’s picture

StatusFileSize
new1.59 KB

Re-rolled it.

dawehner’s picture

+++ b/core/modules/system/system.module
@@ -918,10 +918,13 @@ function system_get_info($type, $name = NULL) {
+ * @param $extension_type
+ *  Either 'module' or 'theme'.
+ *

Are you sure that this function is used at all for themes? I'm pretty sure that \Drupal\Core\Extension\ThemeHandler::refreshInfo and \Drupal\Core\Extension\ThemeHandler::rebuildThemeData cares about it ...

The last submitted patch, 4: 2534100-4.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 10: 2534100-10.patch, failed testing.

isntall’s picture

Patch #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.

The last submitted patch, 10: 2534100-10.patch, failed testing.

alvar0hurtad0’s picture

Status: Needs work » Needs review
StatusFileSize
new523 bytes
new1.59 KB

The patch rerolled and with an issue about documentation fixed

isntall’s picture

And again, #16 is having the same effect on on the qa.d.o and DCI testbots.

Both are being cancelled.

Status: Needs review » Needs work

The last submitted patch, 16: remove_type_argument-2534100-16.patch, failed testing.

isntall’s picture

The last submitted patch, 16: remove_type_argument-2534100-16.patch, failed testing.

The last submitted patch, 10: 2534100-10.patch, failed testing.

alvar0hurtad0’s picture

@isntall, any idea about why?

The last submitted patch, 10: 2534100-10.patch, failed testing.

The last submitted patch, 16: remove_type_argument-2534100-16.patch, failed testing.

The last submitted patch, 10: 2534100-10.patch, failed testing.

The last submitted patch, 16: remove_type_argument-2534100-16.patch, failed testing.

blackra’s picture

Issue tags: -Novice, -php-novice

I 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.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs work » Closed (outdated)

Thanks for the work here to improve Drupal. My research shows that this was fixed in #2659940: Extension System, Part III: ThemeExtensionList and ThemeEngineExtensionList.