Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#64 | 2121175.64.patch | 36.27 KB | jayeshanandani |
#58 | remove_usage_of_drupal_get_form_2121175_57v2.patch | 37.08 KB | Codenator |
#55 | 2121175-55-drupal_get_form.patch | 36.12 KB | grom358 |
#53 | intrdiff_2121175_39_53.txt | 719 bytes | Codenator |
#51 | intrdiff_2121175_39_51.txt | 721 bytes | Codenator |
Comments
Comment #1
tim.plunkettComment #2
dawehnerThis is not a real tim.plunkett patch ... sorry 50KB, this is disappointing.
80
Injecting?
Inject or not inject, this is the question.
Comment #3
tim.plunkett1 Fixed
2 Fixed
3 #1987882: Convert content_translation routes to a new style controller and #1938318: Convert book_remove_form to a new-style Form object
Comment #5
tim.plunkettBroken by #1987806: Convert search_view() to a new style controller
Comment #6
tim.plunkettComment #7
dawehnerIt would be kind of cool if you would have posted a patch which removes drupal_get_form() to see that really nothing uses it anymore.
Otherwise the patch looks great.
Comment #8
webchickGreat patch! Unfortunately, no longer applies.
I'd rather not remove drupal_get_form(), and leave it as a deprecated, one-line wrapper, personally. It doesn't hurt anyone and it makes porting modules easier.
Comment #9
tim.plunkettConflicted barely with #2112635: Convert update_script_selection_form to FormInterface
Comment #10
tim.plunkett#2105609: Convert search_embedded_form_form to a Controller removed some usages, rerolled.
Comment #11
areke CreditAttribution: areke commentedNice patch! It applies now, so RTBC.
Comment #12
webchick10: form-2121175-10.patch queued for re-testing.
Comment #14
sunComment #15
XanoRe-roll. Some occurrences had already been converted.
Comment #16
ianthomas_ukI've confirmed that 15 is a reroll of 10, so would RTBC it if it applied... but it doesn't. This one should (one more example gone).
Comment #17
cosmicdreams CreditAttribution: cosmicdreams commentedI tried to apply this patch, but it needed a reroll. ianthomas_uk can you review and if it passes RTBC? It looked clean to me.
Comment #19
ianthomas_ukWill do. I noticed there were some docblock lines >80 characters, we should wrap those.
Comment #20
cosmicdreams CreditAttribution: cosmicdreams commentedSorry, that went way too fast. Here's a proper patch that also removes the drupal_get_form function. I searched for docblock issues and fixed all the ones I found.
Comment #21
cosmicdreams CreditAttribution: cosmicdreams commentedComment #22
cosmicdreams CreditAttribution: cosmicdreams commentedComment #23
dawehnerWe could think about injecting the form builder into some of the classes in the lower part of the the patch.
Comment #24
Codenator CreditAttribution: Codenator commentedComment #25
Codenator CreditAttribution: Codenator commentedComment #26
Codenator CreditAttribution: Codenator commentedComment #27
Codenator CreditAttribution: Codenator commentedCan't apply patch so I just do re-roll.
Comment #28
Codenator CreditAttribution: Codenator commentedComment #29
Codenator CreditAttribution: Codenator commentedWhat point to change /Drupal::formBuilder()->getForm(); to $this->formBuilder()->getForm(); in controllers.
Any way I test patch and there need re-roll conflict in /core/includes/install.core.inc
Comment #30
Codenator CreditAttribution: Codenator commentedComment #31
Codenator CreditAttribution: Codenator commentedSo I found conflicts from 2121175_18.patch
1. core/includes/form.inc
2. core/includes/install.core.inc
3. core/modules/language/language.admin.inc
4. core/modules/locale/lib/Drupal/locale/Form/LocaleForm.php
Comment #32
Codenator CreditAttribution: Codenator commented20: 2121175_18.patch queued for re-testing.
Comment #34
Codenator CreditAttribution: Codenator commentedOk so rerolled patch there
Comment #35
Codenator CreditAttribution: Codenator commentedComment #36
YesCT CreditAttribution: YesCT commented@Codenator Looking at the size difference between #20 39k, and the patch in #34 718k, I think that the new patch probably has all the core changes since then.
That is not exactly what we want.
adding back the needs reroll tag.
the reroll should be tried again, starting from #20.
follow exactly the instructions in https://drupal.org/patch/reroll
and we should get what we need.
ask questions in #drupal-contribute while going through the steps if any questions arise.
Comment #37
Codenator CreditAttribution: Codenator commentedThanks for response but I do exactly as in instructions there https://drupal.org/patch/reroll
Comment #38
Codenator CreditAttribution: Codenator commentedComment #39
Codenator CreditAttribution: Codenator commentedSo last patch got 3 conflicts
1. Conflict in LocaleForm.php. The patch changed a line in export(), but issue #1978924: Convert locale_translate_export_form to a Controller removed the export(). So resolved the conflict by .. keeping what was in head (no export, nothing to change).
2. Conflict in installer.core.inc (nothing to changed) from Issue #2213357: Use a proper kernel in early installer by sun: Use a proper kernel in early installer.
which were in installer.core.inc.
3. Next one is in form.inc
#22336: Move all core Drupal files under a /core folder to improve usability and upgrades and #2192649: Remove drupal_set_title() from installation and update process so I remove function drupal_get_form() as need do for this issue :)).
see comment #20 in this issue
Thanks YesCT for nice guide and patience :)).
Comment #40
Codenator CreditAttribution: Codenator commentedComment #41
Codenator CreditAttribution: Codenator commentedComment #43
ianthomas_ukThe policy is not to remove the function itself in these patches, as that has caused problems in the past. It can then be removed in a simple followup.
#39 is a reroll of #20 with a few hunks removed, as detailed:
Are you sure you mean #22336? That predates #20 and shouldn't have changed that line anyway (although it will have moved it). #2192649 is the sort of thing you need to be careful with when rerolling - it has removed a call to drupal_get_form(), but has also added a new one, so you need to be careful that's dealt with too. In this case it looks like we're fine though, as HEAD doesn't call it any more (it looks like another issue changed it to use install_get_form() instead).
#23 still needs to be addressed.
HOWEVER...
Much, if not all, of this code is due to be refactored by #1971384: [META] Convert page callbacks to controllers (see the Form builder section), so there seems to be little benefit to cleaning it up now. Resolve those issues, then we can come back and see if anything still calls drupal_get_form().
Comment #44
ianthomas_uk@tim.plunkett pointed out on irc that drupal_get_form() is blocking a change to buildForm(), so it would be good to get this done now rather than waiting for the page callbacks to be done. As this would only be a stopgap change, I don't think we need to worry about injecting the dependencies.
#39 still needs a proper review, but one problem it does have is that it removes the function itself (as mentioned in #43).
Comment #45
Codenator CreditAttribution: Codenator commentedI you check patch from #20 so you can see there function is removed as well by cosmicdreams.
Comment #46
tim.plunkettThanks for getting this done @Codenator!
I agree that we're fine to remove drupal_get_form. We'll be dropping the function-as-param as soon as we can anyway.
Comment #47
ianthomas_uk@codenator just because an earlier patch did something a particular way, doesn't mean it's the right thing to do. Reviews are generally performed on the most recent patch, even if the problem is from an earlier patch.
Even when we're sure that we want to remove a function, we're typically doing the actual removal in a separate patch to the one that removes everything that uses it. That reduces the chance of a patch causing issues, and if the removal patch does cause an issue (breaks HEAD) then it's much easier to resolve.
See #2204143: Remove deprecated drupal_explode_tags() and drupal_implode_tags() for an example where a much simplier patch was rejected because it did both in a single patch.
Comment #48
Codenator CreditAttribution: Codenator commentedSo I return function drupal_get_form() as note ianthomas_uk
Comment #49
Codenator CreditAttribution: Codenator commentedComment #50
jibranI'll miss you drupal_get_form :(
not needed.
Comment #51
Codenator CreditAttribution: Codenator commentedOk I fix from #50 and add right interdiff
Comment #52
YesCT CreditAttribution: YesCT commentedDidn't review the whole patch. (Just noticed this so far.)
these look like unintentional changes.
Comment #53
Codenator CreditAttribution: Codenator commentedSo clean more from comment #52
Comment #55
grom358 CreditAttribution: grom358 commentedComment #56
YesCT CreditAttribution: YesCT commented@Codenator Thanks!
@grom358 was that from the script? (a link to the script here might help those who do not know about it)
Did you do the script and then adjust the comments by hand?
How does it differ from the patch made "by hand"?
Doing that comparison would be a good kind of review here.
Comment #57
Codenator CreditAttribution: Codenator commentedSo clean more from comment #52 with interdiff.
Comment #58
Codenator CreditAttribution: Codenator commentedSorry same windows shells produce bud patch this is right one
Comment #59
Codenator CreditAttribution: Codenator commentedComment #60
yanniboi CreditAttribution: yanniboi commentedI have been having a look at this.
Unfortunately within a couple of hours of the latest patch being posted it no longer applied. (Downside of having sprints is that HEAD moves pretty quick) so we will need to reroll. I am going to review your patch against a6ffb282610 when it last applied.
There is a bit of confusion going on with the patches 53 -> 55 -> 58, but I think I can see what's going on now.
I agree with @YesCT, can we get a link to the script and also work out which patch was posted as a result of the script and then what changes needed to be made manually.
Comment #61
ianthomas_uk#55 is almost certainly from the script, see #2028607: form_set_error issue. A review of the scripted version would be useful, as if the script can do everything then that makes for a much easier reroll.
If we're having trouble keeping up with HEAD then this is not a good patch to commit this week, as it will just break other, more important, patches. But that doesn't mean we can't get it RTBC-ready, with just a quick reroll (hopefully scripted) when we want to commit.
I have spoken to webchick and she suggested that she would be available to review/commit this next Monday, 31st March. If there's a patch here on Monday that applies then I'll review it.
Comment #62
yanniboi CreditAttribution: yanniboi commentedThanks @ianthomas_uk
Other than the reroll, the patch in #58 looks good to me.
Comment #63
Codenator CreditAttribution: Codenator commented@yanniboi, @ianthomas_uk thanks for review
So leave it for Monday 31h March.
Is script work well?
Comment #64
jayeshanandani CreditAttribution: jayeshanandani commentedWorked with @heddn in corementoring on reroll of #58.
Comment #65
XanoAll occurrences have been correctly replaced.
Comment #66
webchickCommitted and pushed to 8.x. Thanks!