Closed (outdated)
Project:
Drupal core
Version:
8.9.x-dev
Component:
other
Priority:
Normal
Category:
Plan
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Apr 2017 at 14:00 UTC
Updated:
30 Oct 2019 at 00:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ritzz commentedWorking on it!!!!
Comment #3
valthebaldUnassigning to let other people work on the issue - 3 days have passed
Comment #4
abarrioHi!
I have found 387 occurrences in code and I'm going to work on it now.
Comment #5
abarrioI have changed all occurrences that I found.
Comment #7
c.nish2k3 commentedComment #8
c.nish2k3 commentedComment #10
c.nish2k3 commentedComment #11
c.nish2k3 commentedsorry, double posted by mistake.
Comment #13
abarrioHi! I have tried to correct errors from last patch.
Comment #14
abarrioComment #16
benjifisherComment #17
nadeemagaskar commentedworking on this issue
Comment #18
nadeemagaskar commentedI found 492 hits and will replacing it
Comment #19
c.nish2k3 commentedComment #20
c.nish2k3 commentedComment #21
c.nish2k3 commentedComment #22
mpdonadioStraight reroll. Rebase + minor merge in dblog.module.
Still 10 usages. See attached.
Comment #23
mpdonadioOK, just saw there was a parent issue on this. Per that, it looks like there should be three issues. Which one should we scope this as?
Comment #24
john cook commentedWhen applying the patch I get:
Because of this, I'm adding the "needs reroll" tag and setting the status to "Needs work".
After applying the changes with the patch utility, there are 17 occurrences of
Drupal::url(including those from the failled hunks.Comment #25
vj commentedRerolled patch
Comment #27
miteshmapFix for failing patch.
Comment #29
miteshmapComment #30
pritishkumar commentedImproved the coding standard errors
Comment #31
jofitzComment #32
vegantriathleteComment #35
ifrikThe patch doesn't apply anymore.
Comment #36
segi commentedI will do a re-roll.
Comment #37
vegantriathleteComment #38
harsha012 commentedre-rolled the patch
Comment #41
vakulrai commentedAdding a patch for the deprecated code.
Comment #43
vakulrai commentedPatch was failing again adding the patch.
Comment #45
lars toomre commented@vakulrai, can you please also post an interdiff with each patch you post? It is difficult to tell otherwise why and how the patch in #43 decreased in size from the one in #41 by about 14 KB. Thanks.
Comment #46
vakulrai commentedComment #48
anmolgoyal74 commentedJust improve minor CS issue.
Comment #50
mpdonadioThere shouldn't be a blank line between the docblock and the function definition.
Comment #51
johnny_aroza commentedmpdonadio i have removed the blank line
Thank you
Comment #53
bserem commentedAttached patch replaces old URL calls everywhere except from core/modules/rdf/rdf.module which when patched break the users administration page (and possibly others).
Submitting for review and testing.
Comment #55
bserem commentedRerolling with phpcs fixes. Updated #2868889: [Meta] Replace all calls of the deprecated Drupal::url() from the code base too.
Comment in #53 is still valid: rdf module is not updated.
Comment #57
bserem commentedRerolling, as phpcs introduced an error with duplicate lines.
Comment #58
abarrioComment #59
bserem commentedComment #60
bserem commentedComment #62
bserem commentedMore PHPCS corrections.
Comment #64
bserem commentedCredits to be credited: bserem, kostask, Sutharsan, sysosmaster
A new patching coming after the social event in DrupalEurope.
Comment #65
bserem commentedRerolling
Comment #67
damienmckenna@bserem: please leave the "credits" section for the maintainers to adjust, it's improper / impolite to remove people from this list if you aren't in a position to commit changes.
Comment #68
bserem commented@Damien: if you check my comment you will see that I removed no one. I simply typed down the usernames of the people that jumped in to help with the issue in DrupalEurope. Thats why I phrased it "credits to be credited", so that I do not forget who they were.
For that reason, I would kindly ask you to rephrase your last comment.
Comment #69
bserem commentedRerolling after fixing linting errors.
Comment #71
bserem commentedComment #73
bserem commentedComment #75
damienmckenna@bserem: My apologies, someone has been changing credits on issues and I mistakenly thought you might have inadvertently done so while noting who worked on the issue with you. I'm sincerely sorry for my mistake.
Could whomever has been changing the commit credits list on this issue please stop doing so.
Comment #79
mpdonadio@bserem, Damien wasn't accusing you of malice. We have just started noticing issues where older credits are vanishing. I restored them, and added the ones you listed (and for full transparency, I had credit vanish).
Also please make sure you post an interdiff with each and every patch. It's one of the few ways a 300k+ patch can be reviewed properly.
Thanks.
Comment #80
mpdonadioOK, here should be a better starting point. #38 looked like the last patch that actually ran.
$ git checkout 8.7.x
$ git log --before '31 Jan 2018' # find a good hash to patch against
$ git checkout d4e8416189983b2ab920eff7b31ffc7a0359ddb3
$ git checkout -b 2869074-38
$ git apply 2869074-38.patch
$ git add -A
$ git commit -m 2869074-38.patch
$ git rebase 8.7.x
There were 12 merge conflicts, I chose HEAD in every case.
$ git add -A
$ git rebase --continue
$ git branch -m 2869074-80
$ git diff 8.7.x > 2869074-80.patch
Think this will run.
And these look like the remaining usages
$ grep -R '\Drupal::url(' core
core/includes/theme.inc: $variables['front_page'] = \Drupal::url(''); core/modules/contact/tests/src/Functional/ContactSitewideTest.php: ':href' => \Drupal::url('entity.contact_form.edit_form', ['contact_form' => 'personal']), core/modules/dblog/dblog.module: '#description' => t('The maximum number of messages to keep in the database log. Requires a cron maintenance task.', [':cron' => \Drupal::url('system.status')]), core/modules/history/history.module: $output .= '' . t('The History module keeps track of which content a user has read. It marks content as new or updated depending on the last time the user viewed it. History records that are older than one month are removed during cron, which means that content older than one month is always considered read. The History module does not have a user interface but it provides a filter to Views to show new or updated content. For more information, see the online documentation for the History module.', [':views-help' => (\Drupal::moduleHandler()->moduleExists('views')) ? \Drupal::url('help.page', ['name' => 'views']) : '#', ':url' => 'https://www.drupal.org/documentation/modules/history']) . '
'; core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php: $this->assertLinkByHref(\Drupal::url('entity.image_style.collection'), 0, 'Link to image styles configuration is found'); core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php: $this->assertNoLinkByHref(\Drupal::url('entity.image_style.collection'), 'Link to image styles configuration is absent when permissions are insufficient'); core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php: $this->assertIdentical($elements[0]->getAttribute('href'), \Drupal::url('search.view_node_search')); core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php: $this->assertIdentical($elements[1]->getAttribute('href'), \Drupal::url('search.view_dummy_search_type')); core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php: $this->assertIdentical($elements[2]->getAttribute('href'), \Drupal::url('search.view_user_search')); core/modules/search/tests/src/Functional/SearchLanguageTest.php: $this->assertUrl(\Drupal::url('search.view_node_search', [], ['query' => ['keys' => ''], 'absolute' => TRUE]), [], 'Correct page redirection, no language filtering.');Comment #82
mpdonadioThat's what I get for not checking my file mask when searching for the actual conflicts.
Comment #83
mpdonadioComment #85
mpdonadioOk, let's see if this at least starts to show fails instead of just "build successful". I think the
should fix a bunch of the problems (which I did a global search/replace on).
Otherwise, I think the
are going to be where a lot of the problems are going to be. If you still get the "build successful", click on the "build successful" link and then "view result on dispatcher". Start one by one, and run them locally and see what is going on. Every time you see a "Exception: Warning: strpos() expects parameter 1 to be string, object given", you need a ->toString() somewhere on one of the conversions.
These two things got AddFeedTest passing. Use that as a starting point.
For now, ignore lint and coding standard errors. Just try to reduce the number of fails, and make sure you add an interdiff with each patch.
For what it is worth, I do the branch-per-patch method and name the branches "2869074-80", "2869074-82", "2869074-85", etc. Then I use
to make my patch and interdiff at the same time, after I have committed everything.
Comment #87
mradcliffeRemoving redundant DrupalEurope2018.
Comment #88
bserem commented@mpdonadio:
Thanks for the oneliner for interdiffs! It will help speed things up.
I will work on this again on Friday, in the sprints, because now the conference is running and there a lot of things happening here.
Builds are succesfull and drupal is running just fine, but we need to add '->toString()' to a LOT of lines. I believe massively changing this in all of core module is difficult and time consuming, because it is easy for conflicts to be added while other people work on other issues.
Nontheless, I have this on my list, and it is a nice timing now that 8.6 just got released.
Our initial idea here at the conference was to script this, so that we could re-roll patches if needed again and again easily.
However, scripting it requires some very tricky regex, and we haven't managed it yet.
@mradcliffe I remember we were adding such tags when things were being worked in DrupalCon sprints.
@DamienMcKenna no harm done ;)
Comment #89
mpdonadioYeah, mega patches are tough. You can do a lot with scripting / creative regex search/replace, but often you just need to just go in an manually touch and debug this stuff...
This patch has revealed the difficulties of doing it all in one swoop. I would suggest rescoping this into four issues/patches:
1. Replace all instances in procedural code (*.inc and *.module).
2. Replace all instances in classes (*.php, but not *Test.php).
3. Replace all instances in tests (*Test.php).
4. Replace anything that got missed was really hard.
I think that will help the patch move faster. I actually don't think there will be much conflict with other work. The changes are rather small, it and should work will with `git patch apply` as long as there is frequent rebasing against HEAD along the way.
Comment #90
xjmI discussed this issue with @bserem and @kostask. Instead of splitting the patch up by file location or even type of file, it's better to split it up by the kind of replacement. Reference: https://www.drupal.org/core/scope#files (and following)
We scanned through the patch and identified several specific patterns:
hook_help()implementations*.api.phpdocumentationAdditionally, there are two specific modules I recommend evaluating in their own issue: Views and the Update module. Some of those modules' usages will fall under the above categories, but the remainder should be examined on a case-by-case basis since both modules could be doing special things with the URLs. For the update module, at least some of them might fall into a more general pattern of "URLs in status warnings" or such.
Finally, a separate consideration is whether the existing
Drupal::url()calls are single-line or multi-line, because that affects the replacement script for the larger changes that we'll need to script. So we might want to handle the multiline calls separately depending on the scope of those larger patches. At the least, we should document how many existing calls are multi-line out of the total number.Thanks!
Comment #91
xjmSince this was the only child of #2868889: [Meta] Replace all calls of the deprecated Drupal::url() from the code base but is the issue that actually has a patch and some discussion, let's actually use this one as the meta. That way we can also make sure contributors from this issue get credited on those. I'm going to close the old parent as a duplicate.
@kostask mentioned that they plan to open the child issues next.
Thanks everyone!
Comment #92
kalyansamanta commentedPlease follow this patch
Comment #93
kalyansamanta commentedComment #94
mradcliffeThank you for providing an additional patch, @kalyansamanta. However this issue is now a "meta" issue based on the new Category "Plan", which means we're not actually posting the patches to do any work here.
As @xjm notes in #90, based on the work and discussion at DrupalEurope by her, @bserem and @kostask, the next step is to create follow-up tasks based on #91 which turned this issue into a meta issue.
As well, I think the issue summary could note that this is now itself a meta based on #90 and #91. I gave that a start, but I think what's remaining is to add Problem/Motivation and Proposed Resolution sections to this issue summary based on the issue summary template so that those who work on the child issues can refer back to how to do it.
Comment #96
volkswagenchickTagging for DrupalNorth 2019
Comment #97
volkswagenchickTagging for DrupalCamp Colorado 2019 (Sunday August 4)
Comment #98
volkswagenchickTagging for badcamp2019, thanks! (October 2-5)
Comment #99
iyyappan.govindHi I have added the latest patch to run the test on 8.8.x branch. Thanks
Comment #101
berdirI think there's nothing left here, \Drupal::url() has been fully deprecated a while ago, this is a leftover.