Needs work
Project:
Drupal core
Version:
main
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Nov 2019 at 08:48 UTC
Updated:
19 Apr 2026 at 22:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
chi commentedComment #6
quietone commentedClosed #3120332: Do not allow @see to reference a namespace as a duplicate. Changing to documentation component because this is API documentation and updating tags.
In that issue longwave suggested
Comment #7
quietone commentedAdding related issue from Coding Standards project.
Comment #9
quietone commentedAdding related issue.
Comment #14
quietone commentedIt was simple task to correct the @see. The harder part was generating the proxy files. I happened to test with the book module and the script was not providing any feedback. I eventually found #2539494: Provide a nice error message when trying to run the generate proxy class script on uninstalled/missing modules which informed me that the book module needs to be enabled. With that fixed I then went to generate the files. I didn't see an option to generate all the files so I wrote my own script to do that.
Looking at the changed proxy files they all have the expected change except for ./core/modules/field/src/ProxyClass/FieldUninstallValidator.php. That has a method added that was added to ./core/modules/field/src/FieldUninstallValidator.php in #2392815: Module uninstall validators are not used to validate a config import. I suspect that is out of scope for this issue.
Comment #15
smustgrave commentedCould the issue summary be updated? Not super clear what's being updated.
Also will this require a test case?
Comment #16
quietone commentedThis is a fix to documentation, specifically @see statements and we don't test documentation changes. As for generating the proxy classes, that is done via a script, so again no tests needed.
Comment #17
smustgrave commentedWhat about the change to core/modules/field/src/ProxyClass/FieldUninstallValidator.php
Comment #18
quietone commented@smustgrave, as the reviewer your opinion is valuable. What do you think should happen?
Comment #19
smustgrave commentedMore asking. This is a documentation change but the one file is adding a new method
Comment #20
spokjeDropping my 0.02 EUR...
Changes in phpdoc are fine/excellent.
The new method that was missed in #2392815: Module uninstall validators are not used to validate a config import should be added, but the fact that it was missed and that @quietone needed to make a script to recreate all proxy classes shows IMHO that we're (at least) missing test-coverage.
For that reason I would say, it needs a follow-up to add it and make sure we have "something" that makes sure that this doesn't happen in the future. Especially the latter justifying the admin-overhead of a follow-up
Comment #21
smustgrave commentedThanks @Spokje! @quietone are you in agreement?
Comment #22
smustgrave commentedComment #23
nikolay shapovalov commented@quietone can you please share the script to generate all the files?
Comment #24
quietone commented@nikolay shapovalov, each file generated by core/scripts/generate-proxy-class.php has a comment with the full command used to generate this file. I simply gathered those into a bash script.
Followup is, #3503965: Add test to ensure generated proxy files are up to date
Comment #25
borisson_The latest run on the pull request doesn't succeed. I should be rebased. The follow-up in #24 is what resolves the questions in #21.
So I think this needs a rebase (and possibly a rerun of the script in #24), then it is good to go imho.
Comment #26
quietone commented@borisson_ actually, that error is 'real'.
I don't know why there is a phpstan error on the file. I intended to leave a comment but clearly I forgot. I have added finding out why this is happening to the remaining steps.
Comment #33
sivaji_ganesh_jojodae commentedThe issue still needs fix however the fork has no main branch. The existing branch or new branch from 11.x are showing unwanted changes from other issues as well.
Comment #37
quietone commentedI don't understand the comment about "the fork has no main branch". I certainly see it and do on each of the branches.
I rebased the original branch and pushed.
Comment #38
quietone commentedGenerated the proxy files and there is now a phpstan error.
Comment #39
sivaji_ganesh_jojodae commentedThank you @quietone. I've fixed the phpstan errors. The piepline seems okay now.
Comment #40
quietone commented@sivaji_ganesh_jojodae, the file core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php is automatically generated and is not meant to be edited by hand. One way to find that is to read the beginning of the file. It shows how the file is generated.
I think that the last commit should be reverted. And then figure out why the ProxyBuilder is creating incorrect code.
Comment #41
sivaji_ganesh_jojodae commentedAdding the following check prevents from settings return type to
?mixedinRouteBuilder::__get()Now running
php core/scripts/generate-proxy-class.php 'Drupal\Core\Routing\RouteBuilder' "core/lib/Drupal/Core"generates same code as in last comment.May i commit the above change?
Comment #42
sivaji_ganesh_jojodae commentedI've pushed the above change.
Comment #43
oily commented@sivaji_ganesh_jojodae I am reverting RouteBuilder.php to see if your code fix works.
Comment #44
oily commentedComment #45
oily commentedComment #46
quietone commentedTo prove the change to PRoxyBuild is correct all the files generated by the proxy builder must be re-generated.
Comment #47
quietone commentedNot really related. The @see here are just wrong.
Comment #48
oily commentedI have run the bash script supplied by @quietone on a local ddev site.
The script output was:
The only change to core files caused by running the script is to the RouteBuilder.php file as revealed by 'git status'. Running 'git diff core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php' output this:
So it seems to have corrected the '@see' path. Also it has added 7 additional lines.
I switched to the 'main' branch and re-ran the script of @quietone. The regenerated RouteBuilder.php file contains the __get() function. The only difference is that the 'mixed' return type has the '?' nullable operator so is '?mixed'.
In fact there are a bunch of other files that get generated but that are untracked. For example, core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php.
Comment #49
oily commentedAnyone who wants to run the script using a ddev installation of github version of drupal, a tip: remember to install the site so just make sure you can launch it and see the homepage. Then use 'ddev ssh' before running the script..
Comment #50
oily commentededited When running the script on the main branch it modifies two files, the RouteBuilder.php as already described but also the core/lib/Drupal/Core/ProxyClass/Menu/MenuActiveTrail.php file.
Not sure why that only happens on the main branch but not on the issue branch?