Issue #3358570: InstalledPackage::scanForProjectName should check if project key is empty before checking if it is string
2 unresolved threads
Merge request reports
Activity
98 98 $info = file_get_contents($match[0]); 99 99 $info = Yaml::decode($info); 100 100 101 if (is_string($info['project']) && !empty($info['project'])) { 101 if (!empty($info['project']) && is_string($info['project'])) { changed this line in version 2 of the diff
added 5 commits
-
845cd39a...34a00b34 - 3 commits from branch
project:3.0.x
- d015e363 - Merge branch '3.0.x' into 3358570-check-empty-first
- 93a70fa2 - Add test coverage
-
845cd39a...34a00b34 - 3 commits from branch
123 123 124 // The `project` key has been removed from the info file. 125 (new ActiveFixtureManipulator()) 126 ->addProjectAtPath('projects/no_project_key') 127 ->commitChanges(); 128 $list = new InstalledPackagesList([ 129 'drupal/no_project_key' => InstalledPackage::createFromArray([ 130 'name' => 'drupal/no_project_key', 131 'version' => '1.0.0', 132 'type' => 'drupal-module', 133 'path' => $projects_path . '/no_project_key', 134 ]), 135 ]); 136 $info_file = $list['drupal/no_project_key']->path . '/no_project_key.info.yml'; 137 $this->assertFileIsWritable($info_file); 138 file_put_contents($info_file, '{}'); If we just set the how file as empty we can't really be sure in the test that won't run into the same original problem if the file had other valid values. This test assumes the file won't be skipped for other reasons if it is not valid.
We should be changing only the project key.
Edited by Ted Bowmanchanged this line in version 4 of the diff
Please register or sign in to reply