Problem/Motivation
Found when testing #3351895: Add Drush command to allow running cron updates via console and by a separate user, for defense-in-depth. Got many errors like this on the console
Steps to reproduce
Proposed resolution
InstalledPackage::scanForProjectName should check if project key is empty before checking if it is string
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork automatic_updates-3358570
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
tedbowJust putting in the fix. We will now need tests
I noticed
scanForProjectNameis only called ingetProjectNameandgetProjectNamemarked as being tested in\Drupal\Tests\package_manager\Kernel\InstalledPackagesListTest::testPackageByDrupalProjectNamebut it does not call it directly. So may want to test specific to\Drupal\package_manager\InstalledPackage::getProjectNamethe covers that case that no info.yml as the `project` key andscanForProjectNamereturn NULL. and a case where a top level info.yml does not have a project key but a nested on does, assuming it will find the top level one first it should not error.Comment #5
phenaproximaAdded test coverage and confirmed that it fails, with the expected error message, without the fix.
Comment #6
phenaproximaComment #7
tedbow1 suggestion on the test
Comment #8
phenaproximaComment #9
tedbowLooks good!
Comment #11
phenaproximaComment #12
wim leers