Active
Project:
Upgrade Status
Version:
4.0.0
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 May 2021 at 10:01 UTC
Updated:
3 Oct 2023 at 06:19 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
bahuma20Added installed package versions
Comment #3
bahuma20I've added the "--no-progress" flag to the command in DeprecationAnalyzer.php.
https://git.drupalcode.org/issue/upgrade_status-3213598/-/commit/2f60fb0...
The progress bar is now gone, but the outcome still shows "PHPStan failed":

Comment #4
gábor hojtsyHm, have not seen this before :/ Can you try https://github.com/mglaman/drupal-check on the same module to see if that worked? Thanks!
Comment #5
bahuma20I already did this.
drupal-check gave me this output:
A status bar and the "No errors" message.
I get the same output on every module. It's not a modules fault...
Maybe the phpstan released a new version that generates progress bars and different output that cannot be parsed by the upgrade_status module?
Comment #6
mglamanProgress bars always print to stderr
Based on the above output, though, the raw errors were returned due to an unexpected error. See https://git.drupalcode.org/project/upgrade_status/-/blob/8.x-3.x/src/Dep...
Comment #7
gábor hojtsyThe screenshots look strange because if there is valid JSON returned, we take that as a valid return value. Visually looking it does not seem like what you got is invalid JSON?! Either way, if you still have sites to port, it would be great to try with 8.x-3.11 which changes how phpstan is executed.
Comment #8
kt2ssh commentedI got the same problem and found the unexpected <?php tag from phpstan result.
Comment #9
fgmIt looks like a similar problem I just met: I have a custom theme that extends a base theme but does not include a single line of PHP, so when running an upgrade_status 4.0 scan, I get this error
Adding an almost empty (theme).theme file fixed the issue for me.
Comment #10
gábor hojtsyThat there was no file found to analyse sounds like a legitimate problem. At least it does not say everything was ok because there was nothing to check if it was ok. I guess for themes that could be a realistic scenario that no PHP file was found, but it would only be reasonable for modules very rarely. Should we have a special case for this situation? We would still need to somehow surface that there was no file scanned, but maybe a nicer error handler for this case?
Comment #11
fgmI think one could imagine a module only consisting of libraries, so with a mymodule.libraries.yml and a bunch of CSS / JS files pointed by those, so no PHP code either.
That's probably not common but does not have to be an error. It's a bit similar to the "theme extends a base theme, only changing CSS / JS".
Comment #12
gábor hojtsyLet's focus this issue on the no files case then. The others don't seem to have more info on why they would happen.
Comment #13
gábor hojtsyHowever how we represent this situation is a question. That no file was found could be an error or it could be a legitimate thing to ignore. So we should IMHO report it, but maybe not as a raw error, but more like a warning level? It would still show it as one problem to resolve though, so those that want to make that go away would "need to" add an empty module file or somesuch for the error to go away. We can maybe discourage that in the message?
Comment #14
tobby commentedFWIW, I'm having the same issue. I've got a module with only
my_module.info.ymlandmy_module.libraries.ymlfiles, so I get the "No files found to analyse" warning. I created a temporarymy_module.modulefile, and I was able to validate that the module is indeed D10-ready.I agree with Gábor -- maybe this "no file" issue can be a warning or even an info level. And place it in a "Compatible with next major Drupal core version (with caveats)" category instead of "Fix manually". My thinking is that a module with no executable code is technically compatible with Drupal 10...
Comment #15
sahilgidwani commentedAnyone can please look into this and implement a solution to resolve the issue mentioned above.