Closed (cannot reproduce)
Project:
Upgrade Status
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Apr 2019 at 05:08 UTC
Updated:
10 Jul 2019 at 14:24 UTC
Jump to comment: Most recent
Comments
Comment #2
herczogzoltanHey @Rutuj !
Thanks for the report! We released a new alpha version which contains extra features and bug fixes as well: https://www.drupal.org/project/upgrade_status/releases/8.x-1.0-alpha2
That would be a great help if you could try it out and comment if it solved your issue!
In case the issue still occurs, can you please provide the full backtrace (if you see any) or a list of modules that you use?
Comment #3
tclark62 commentedWe have this error, too. I believe it's because our site wasn't installed with composer and therefore the vendor directory is in Drupal root directory. The backtrace is below.
I was able to get it to work for our site by changing line 55 of [...]\vendor\mglaman\phpstan-drupal\src\DependencyInjection\DrupalExtension.php accordingly:
However, though this error no longer appears, and this solution worked for the alpha1 version, I get other, unrelated problems with alpha2 so that it doesn't scan any modules anymore.
Comment #4
gábor hojtsyIf you don't install this module with composer, several dependencies will not be downloaded. How did you get phpstan-drupal?
I think we can add requirements checks in this module to make sure the dependencies are at the place we expect them and don't let you enable it in Drupal if not so, but it would be important to understand how did you install it and what are the directory structures you have for core and this module's vendor libraries in particular.
Comment #5
gábor hojtsyRefocusing as a task.
Comment #6
gábor hojtsyBranch test on the project now result in the same problem, haha. So it probably is not just the dependency installation problem. Hm.
Comment #7
gábor hojtsyBranch test with this fail at https://www.drupal.org/pift-ci-job/1316817
Comment #8
mglamanThe error is in PHPStan-Drupal
The code (which is a copy of Drupal core's)
I'm guessing $this->root is somehow false?
Comment #9
gábor hojtsy@mglaman: right, that does not mean that the problem is not caused by our module passing on invalid data :) I don't know honestly :)
Comment #10
mglamanYep, I don't think there are any guards here. $this->drupalRoot could be false.
Set by
https://github.com/mglaman/phpstan-drupal/blob/master/src/DependencyInje...
Comment #11
kfritscheFor me the following fix worked: https://github.com/mglaman/phpstan-drupal/pull/75
After this I could run the tests locally for upgrade_status.
It fails but not tests fail?
PHPunit Test failed to complete; Error: PHPUnit 6.5.14 by Sebastian Bergmann and contributors.
Testing Drupal\Tests\upgrade_status\Functional\UpgradeStatusDeprecationDashboardAccessTest
.. 2 / 2 (100%)
Time: 52.28 seconds, Memory: 6.00MB
OK (2 tests, 11 assertions)
HTML output was generated
...
Remaining deprecation notices (2)
2x: The ""Symfony\Component\BrowserKit\Response::getStatus()"" method is deprecated since Symfony 4.3, use getStatusCode() instead.
1x in UpgradeStatusDeprecationDashboardAccessTest::testDeprecationDashboardAccessUnprivileged from Drupal\Tests\upgrade_status\Functional
1x in UpgradeStatusDeprecationDashboardAccessTest::testDeprecationDashboardAccessPrivileged from Drupal\Tests\upgrade_status\Functional
PHPunit Test failed to complete; Error: PHPUnit 6.5.14 by Sebastian Bergmann and contributors.
Testing Drupal\Tests\upgrade_status\Functional\UpgradeStatusAnalyseTest
. 1 / 1 (100%)
Time: 53 seconds, Memory: 6.00MB
OK (1 test, 26 assertions)
HTML output was generated
...
Remaining deprecation notices (2)
2x: file_prepare_directory() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::prepareDirectory(). See https://www.drupal.org/node/3006851.
2x in UpgradeStatusAnalyseTest::testAnalyser from Drupal\Tests\upgrade_status\Functional
PHPunit Test failed to complete; Error: PHPUnit 6.5.14 by Sebastian Bergmann and contributors.
Testing Drupal\Tests\upgrade_status\Functional\UpgradeStatusUiTest
... 3 / 3 (100%)
Time: 1.89 minutes, Memory: 6.00MB
OK (3 tests, 54 assertions)
HTML output was generated
...
Remaining deprecation notices (2)
2x: file_prepare_directory() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::prepareDirectory(). See https://www.drupal.org/node/3006851.
2x in UpgradeStatusUiTest::testUiAfterScan from Drupal\Tests\upgrade_status\Functional
Comment #12
volkswagenchickTagging for DrupalNorth 2019
Comment #13
gábor hojtsyThis will be resolved by a followup to #3057853: Update to new PHPStan version for @deprecated support once another upstream fix is adde to the double Drupal class declaration. Currently half-broken in dev but @mglaman is working on it now. Nothing to do here.
Comment #14
gábor hojtsyhttps://www.drupal.org/project/upgrade_status/releases/8.x-1.0-alpha4 includes all the fixes and should work, please test!
Comment #15
gábor hojtsyAssuming this works, given no feedback in almost 4 weeks.