Problem/Motivation
Currently, file and image field's field formatter doesn't have support to render/display absolute URL.
ImageUrlFormatter and UrlPlainFormatter classes doesn't have flexibility to display absolute url.
Steps to reproduce
Configure the field formatter and check that we don't have flexibility to render absolute url.
Proposed resolution
- Add an option to both the field formatters.
- Validate option value in viewElements() method and display URL accordingly.
- Add test cases to validate newly added options.
Remaining tasks
Contact Usability for wording of new text in the UI.
- Review MR https://git.drupalcode.org/project/drupal/-/merge_requests/5882 which represents further changes since patch #122
User interface changes
- New option is added on both the field formatters.
File field:


Image field

API changes
- N/A
Data model changes
- N/A
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-2811043
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
stijnstroobantsComment #3
stijnstroobantsComment #4
stijnstroobantsUpdated the settingsSummary
Comment #5
stijnstroobantsComment #7
stijnstroobantsAdded settings to schema.yml
Comment #8
stijnstroobantsComment #10
stijnstroobantsUpdated test file field formatter settings
Comment #11
stijnstroobantsComment #12
dawehnerSo wait, we make it absolute by default?
The indentation is a little bit off.
Its a boolean, I think
$this->getSeting('absolute_url')should be enough.Comment #13
stijnstroobantsThanks for the reply!
Yes, I'm testing the absolute as TRUE by default, is that not the right way to do it?
There was indeed a gap in the indentation.
Oops indeed, a boolean is just true or false :-) Don't need to check the value of the boolean again...
I'm pretty new to D8-coding, so still a lot to learn! :-)
Comment #14
stijnstroobantsComment #18
stijnstroobantsComment #19
stijnstroobantsComment #20
stijnstroobantsComment #23
stijnstroobantsComment #24
stijnstroobantsComment #26
stijnstroobantsComment #27
stijnstroobantsComment #28
stijnstroobantsComment #30
stijnstroobantsComment #31
stijnstroobantsComment #33
stijnstroobantsComment #34
stijnstroobantsComment #35
stijnstroobantsComment #36
stijnstroobantsComment #37
tstoecklerI think that now that #2517030: Add a URL formatter for the image field is in, we should also update the new
image_urlformatter to have the same option. Also we could use some tests here and we definitely need an upgrade path.Comment #38
stijnstroobantsComment #39
stijnstroobantsHi, thanks for the reply.
I think for the image_url formatter we should create another issue, because it's a seperate component.
In the patch there are tests.
Why we need an upgrade path if this formatter was not by default available in D6/D7 core?
Thanks!
Comment #41
stijnstroobantsComment #42
stijnstroobantsComment #44
heddnI agree we need tests. But I'm not sure we need an upgrade path.
Nit: short array syntax.
Comment #45
heddnAnd here's a re-roll with the array stuff fixed. No interdiff as its just a re-roll (with array short syntax fixes).
Comment #46
stijnstroobantsThanks for the short array syntax fix. Makes sense!
Comment #48
edysmpreroll to 8.6.x
Comment #49
heddnIt looks like from #37 we should to this for image_url formatter as well. This is small enough, let's just do it all in one place.
So, NW for that and tests.
Comment #50
jyoti.singh commentedPatch for the #37. Adding the absolute url for the Image Url field formatter.
Comment #51
jyoti.singh commentedComment #52
msankhala commentedThis can be shorten as:
This empty line is not required.
This can be shorten as:
This empty line is not required.
Here are some of the feedback. @jyoti.singh Can you please provide interdiff as well. We need tests for this patch as well.
Comment #53
jyoti.singh commentedThank you @msankhala for the feedback , updating the patch for the same.
Comment #54
jyoti.singh commentedComment #56
jyoti.singh commentedAttaching another patch for the comment #52
Comment #57
msankhala commentedThese empty lines can be removed. @jyoti.singh Can you please provide the interdiff as well? https://www.drupal.org/documentation/git/interdiff
so it makes it easy to review what you have modified since the last patch.
This patch requires test cases as well. I think the test for these should go inside
FileFieldDisplayTestandImageFieldDisplayTest.Comment #60
eescribanoc commentedFor Core 8.7 the last patch didn't work so I remade it.
Comment #61
eescribanoc commentedSorry, got bad name for the patch, re-uploading it.
Comment #62
hctomIs there a special reason why you do not use the
$relativeparameter ofcreateFileUrl()directly? This method already has all the logic to return a relative or absolute URL.Comment #63
berdirBecause that's new and didn't exist when this code was written, agree that it should be used now.
I'm also wondering about the use case from the issue summary:
> When sending the values in a mail (contact form), it should render the absolute url so you can click directly to the file from within a received mail.
Drupal core should now automatically convert relative URL's in e-mails to absolute, are there other reasons for this? We've worked hard in Drupal 8 to avoid absolute urls whenever possible.
Comment #66
hlopes commentedRSS Feeds
Applies cleanly on 8.9, tested with views formatter, works fine.
Comment #67
berdir> RSS Feeds
Yeah, covered: \Drupal\Core\EventSubscriber\RssResponseRelativeUrlFilter
Comment #68
hctom@berdir: Uh nice... didn't knew about that one. That looks very promising... But apart from that I still think it is a good idea to let the site builder decide if for whatever reason there is an absolute URL output required.
Maybe there should be some sort of short description on the checkbox field explaining why absolute URLs may lead to trouble in certain cases.
...so if this feature should still get in, my finding in comment #62 should still be implemented - let me know if I should change the patch for it, or if this issue will more likely to be closed?!
Comment #69
hlopes commentedI see, this works but for description field only. My use case also has html in other rss item field (don't ask), hence why.
Still I tend to agree with #68.
Comment #71
mohit_aghera commentedAdding three test cases to validate field formatter changes and configuration.
Comment #72
mohit_aghera commentedReuploading the above patch with relevant fixes.
- It contains three test cases to validate field formatter changes and configuration.
- PHPCs error fixes in the above patch.
I've intentionally kept diff against comment #61 so we can easily see the diff between those.
Update:
Accidentally added interdiff with .patch extension instead of .txt
Comment #75
berdirthe assert() needs to move up before a method on $file is called, and we can still use createFileUrl(TRUE/FALSE) here. In fact, you can just use $file->createFileUrl(!$this->getSetting('absolute_url'))
Also, if we do make it absolute, we need to add the url.site cache context and should assert that as well.
Comment #76
mohit_aghera commented@Berdir, thanks for the suggestions.
I've included those in the current patch. I've also updated test cases accordingly.
Comment #78
mohit_aghera commentedResolving issues in
testImageFieldFormattersPrivate()test case.@berdir, somehow functional javascript tests are failing on DrupalCI. Is there any way to identify which is causing issues?
Comment #79
berdirI'm.. not sure what this is testing exactly. You're asserting the response, but you're not actually visiting a page here, at least for the public case, so your assertion has nothing to do with what you are rendering, the url.site cache context just happens to be on the page the test last visited. And it doesn't work for private, because a few lines above, access denied is tested for private and that page doesn't have it.
But we don't actually need to do that, instead, lets just assert the render array directly, you're already looking at #markup, just assert ...['#cache']['contexts'] directly, with an assertContains(). And then also ensure that it's not there if you set absolute_url to FALSE.
Comment #80
mohit_aghera commentedUpdating test cases as per the above comment.
Comment #82
anas_maw commentedReroll the patch to work on the latest version
Comment #83
sokru commentedPatch on #82 failed to apply, here's a reroll.
Comment #85
ankithashettyUpdated deprecated code in #83.
file_create_url() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the appropriate method on \Drupal\Core\File\FileUrlGeneratorInterface instead. See https://www.drupal.org/node/2940031file_url_transform_relative() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\File\FileUrlGenerator::transformRelative() instead. See https://www.drupal.org/node/2940031Thanks!
Comment #87
anweshasinha commentedI am working in it.
Comment #88
anweshasinha commentedHi,
I have created a patch for the absolute url for image. Please review it.
Comment #90
heddnComment #92
anas_maw commentedReroll the patch to work on 9.4.x
Comment #93
Munavijayalakshmi commentedpatch #85 re-rolled (9.5.x).
Comment #94
Munavijayalakshmi commentedComment #97
ddiestra commentedMake it work for 9.4.8
Comment #99
AshM commentedMake it work for 9.5.0
Comment #100
_utsavsharma commentedFixed CCF for #99.
Please review.
Comment #101
_utsavsharma commentedComment #103
mohit_aghera commentedAttempt to fix the test case failures.
Both the failing test cases are passing on local now.
It seems that older instance of
file_create_url($uri)should be replaced with$file_url_generator->generateAbsoluteString($image_uri).It was set as
$file_url_generator->generateString($image_uri).Comment #104
smustgrave commentedSeems in all the reroll starting in #93 some files were add/removed from the original patch.
Was there a reason why?
Comment #105
hitchshockHi @smustgrave Not sure what do you mean about "original patch"? Which one is original? The first one? Then it's normal that other people have expanded it, improved it and added tests.
If you're talking about another patch, why do you consider it original?
I looked at the patch development trend and concluded that #103 is a logical result of the current patch evolution.
I installed and tested the patch for two Drupal sites: 9.4 and 9.5.
The patch works perfectly for me.
FYI. for 9.4 I used #97, but I had to update that patch a bit. Fixed the same URL issue as in #103
Added my patch to the issue but hid it, because 9.4 is already outdated.
Comment #106
smustgrave commentedWill let someone else review. #88 attempted a change that had a few files more then in #85.
Then #93 rerolled #85, so skipping #88 was that change not needed? No one seems to answer that.
Lack of interdiffs and comments don't explain why things are added or removed.
To me this needs an issue summary update now.
Comment #107
mohit_aghera commentedI have reviewed both the patches closely. #85 and #88
The changes in #88 seems completely in wrong direction.
Basically, key thing i.e. field formatter
ImageUrlFormatter.phpitself is missing from the patch.I am hiding the patch given in #88 so we can have proper sequence.
Adding issue summary for clear direction.
Comment #108
quietone commentedThanks to everyone for getting this older issue close to commit.
It appears that this is a self RTBC, #105. So this, at least, needs another review.
This is a feature request so we need a patch on 10.1.x. I am changing the version. Refer to the allowed changes policy for details.
I was going to look at the patch but, honestly, I do not know which one I should review. Hopefully, that will be clear when there is a patch for 10.1.x.
This also needs a title that better explains the change.
Thanks.
Comment #109
mohit_aghera commentedThis is turning out to be somewhat confusing.
It seems that the patch in #93 is re-rolled against #85 because #92 and #88 contains the diff related to quick edit module.
So #88 and #92 seems somewhat incorrect to me.
#105 seems against 9.4.x, so we can ignore the patch.
Coming to conclusion:
@quietone, I noticed that the patch in #103 is getting applied on latest 10.1.x head.
I have triggered re-test of #103 to see how it goes.
Comment #110
quietone commented@mohit_aghera, thanks! I was really quite lost and spending too much time trying to figure this out. So, the patch to work with is #103.
As best I can tell, the last review of the patch was in #79, and we have a confirmation that it works in #103. So, we still need a fresh review. I am changing the status to NR for that.
The next step is to review the patch in #103.
Comment #111
smustgrave commentedReviewing #103
Appears to be adding a new field option, so probably needs a change record.
Also will need an upgrade path for existing sites.
Comment #112
mohit_aghera commented- Added a post update hook to change the field formatter settings.
- Add a test case to validate the post update hook.
Comment #113
smustgrave commentedThink the only thing left would be the change record! Almost there!
Comment #115
pnagornyak commentedthis solution does not work with image styles, absolute URL is generated for original image only :(
Comment #116
mohit_aghera commentedChange record added here https://www.drupal.org/node/3368703
Keeping this in needs work as I'm yet to check #115
Comment #117
mohit_aghera commentedI was able to reproduce the issue mentioned in #115
Attached a patch and test case for the same.
Comment #119
mohit_aghera commentedFixing test case failures.
Comment #120
smustgrave commentedPatch no longer applies cleanly to 11.x
but it was such a small change I just went ahead and did it.
With the patch applied verified the update hook ran without issue
Verified the view display setting on an Image field.
Created a node with the field setting set to absolute.
Verified the URL rendered as absolute.
Comment #122
mohit_aghera commented- Patch is not getting applied to latest 11.x head. I did the rebase of the patch.
- Fixing test case failures. Test cases are passing on local now.
Let's see how it goes for CI pipeline.
I'm not quite sure why it was working previously and suddenly stopped working.
Comment #123
mohit_aghera commentedComment #124
smustgrave commentedSeeing all green so restoring status. Thanks @mohit_aghera!
Comment #125
quietone commentedI'm triaging RTBC issues. I read the IS and the comments. I didn't find any unanswered questions.
Thanks for getting this 7 year old issue to RTBC!
This is making a change to the UI, adding the usability tag. There should be a screenshot for the change in the issue summary, or linked to from there.
That made me think of the change record so I read that. It does needs updating to provide the reader with the information needed to use this new feature. It should be explicit about where the new setting is found, which form and the url. Also it would help to have a screen shot. I've added the tag for an update to the change record.
I then read the patch, noting the following points.
Why is there no corresponding change in the same test for migration from Drupal 7 sources?
nit: should be added alphabetically
I am all for comments but this seems unnecessary as the if block is clear.
This is really testing the update of the value. I think this is an improvement.
" * Tests update of the 'absolute_url' file and image field formatter setting."
This should use 'assertFalse'
No quite meeting the standard, also is should be 'absolute_url'. Drupal API documentation standards for functions
I suggest, "Tests the 'absolute_url' setting on the field display setting form."
Similar to above. I suggest, "Tests the absolute_url setting with the image style setting."
These need work, there is a common assert to each if/else.
The same code is executed for public and private.
Finally, the comments are inconsistent when referring to the new setting. Sometimes 'option' is used instead of 'setting' it would be helpful to be consistent on that.
So, nothing major just a few things to tidy up.
Comment #126
angrytoast commentedAdding an updated patch + interdiff with changes based on most of the feedback in #125. Specific points:
1. The D7
MigrateFieldFormatterSettingsTestdoes not have any cases offile_url_plainwhich differs from the D6 version. Not sure on how to proceed here as it seems like it'd be a bigger change in the test migration?8 + 9. It seems like the
publicvsprivatepaths ultimately ended up with the same assertions so that the only difference came down toprivatetriggering a logout in the test. That didn't seem necessary as the tests were asserting on the existence of theurl.sitecache context which should exist regardless of auth state. Ended up removing theifpaths.Also updated the Change Record with more descriptions and Issue Summary to include screenshots.
Comment #130
smustgrave commented#3041402: Add option absolute url in formatter URL to image closed as a duplicate and moved over credit.
Comment #132
angrytoast commentedUpdated to use a MR because the patch triggered DrupalCI process looks to be failing consistently due to disk space issues in the Jenkins based builds.
Same changes as patch in #126, the interdiff between 122 and 126 is represented in this commit
Comment #133
smustgrave commentedLeft some feedback, all minor stuff.
Comment #134
angrytoast commentedAddressed feedback from #133. Not sure about MR resolving policy, setting this back to Needs Review to get eyes on it.
Comment #135
angrytoast commentedComment #136
smustgrave commentedMy feedback has been addressed.
Comment #137
quietone commentedI'm triaging RTBC issues. I see I have been here before and this is steadily making progress. I read the IS, which appears to be up to date, and the comments. I didn't find any unanswered questions.
This is adding a new string to the UI and I see from the screenshots that there is inconsistent capitalization of URL. Also, I don't think that 'render' is used in the Drupal UI. So, this needs input from usability for the correct wording. I don't know why I didn't see this before. I am setting this to needs work for getting feedback from the usability team. I'll tag it as well, for visibility.
Although, someone here can ask in #usability for advice. If you do, add who responded to your comment. Thanks.
I did not review the MR or consider if this deprecation can occur in 10.3.
Comment #138
rkollerUsability review
We discussed this issue at #3411359: Drupal Usability Meeting 2024-01-05. That issue will have a link to a recording of the meeting.
For the record, the attendees at the usability meeting were @benjifisher, @Emma Horrell, @rkoller, @shaal, and @simohell.
If you want more feedback from the usability team, a good way to reach out is in the #ux channel in Slack.
At first thanks on working on the issue as well as that the issue summary was in good shape. That saved a lot of time and left more time to focus on the issue itself. We've based our explorations and discussions on the latest state of MR5882 on a Drupal 11.x-dev install with a content type which had a file, image and media field added. At first a few points we've noticed:
Manage displaypage of a content type, per default, the summary for those three fields showsRendered as relative url. When you edit the field you are only presented with theRender as absolute urlcheckbox - no signs of a setting for the relative url which was shown and referred to in the summary overview. The state of "relative url" is hidden or better is just communicated indirectly. If the checkbox is unchecked you get the relative url, if the checkbox is checked you get the absolute url - that fact adds a cognitive load to the user.renderin this context. The group agreed that it is probably not quite the right word. The termrenderwould probably be more appropriate for example in the context of rendering templates.If checked, links will be rendered as absolute urls.in context with the checkbox labelRender as absolute urlisn't really explaining anything or adding any extra information. It is mostly repeating the checkbox label prepending the constraintIf checked, links will be. At the same time things become tricky if you want to actually cover and explain all the dos and don'ts when a checkbox is checked. The description would become lengthy and hard to read.urlis only lower case. According to https://www.drupal.org/docs/develop/user-interface-standards/interface-t... acronyms likeURLshould be capitalized.There was a clear consensus in the group about the following recommendations:
Render as relative urlandRender as absolute urltoRelative URLandAbsolute URL. Ideally the details of interest,Relative URLandAbsolute URL, should be front-loaded (currently the user has to scan past 10 characters before the detail of interest is reached). For this context we also agreed on less is more and simply removed the "Render as ".Show link asand for the radio button labels go withRelative URLandAbsolute URL.For one by using radio buttons the relative URL option would become explicit in the UI and the case that each option would start redundant with
Render asas well as the term "render" would be avoided by moving to the more neutral wordShowin the legend. We were only a bit uncertain at first about adding a radio button group with just two options. But while writing up the comment I've revisited the user interface standards for radio buttons on d.o: https://www.drupal.org/docs/develop/user-interface-standards/radio-buttons and having a list of two is a legitimate case https://www.drupal.org/docs/develop/user-interface-standards/radio-butto.... Avoiding redundancy by moving parts of the radio button labels to the legend is also in line and recommended in https://www.drupal.org/docs/develop/user-interface-standards/radio-butto....Relative URLis selected the suggestion would beExample: /sites/default/files/image.png, whenAbsolute URLis selected the suggestion would beExample: https://www.example.com/sites/default/files/image.pnginstead. We've just slightly shortened the examples used on https://www.drupal.org/node/3368703. But by using radio buttons and a description that adjusts dynamically to the selected radio button, things would become completely self-explanatory and clear. In case the dynamic description is out of the scope for this issue it could be also moved to a follow up issue?At the end one additional detail that was noted during the discussion - not a recommendation or suggestion but more of question. It was asked if the functionality was tested on a site that utilizes for example the
Domainmodule or any other similar module and if there might be potential problems?I'll remove the
Needs usability reviewtag again.Comment #139
rkollerAnd one additional note i've noticed when i've looked at the change record before the meeting (@angrytoast pointed me to it helping me to understand the scope and problem space of the issue). I've already commented on Slack in the #ux channel that the current state of the change record is potentially misleading in the context of the views based REST export json responses.
In the first section (
Example screenshots for site builders:) you have screenshots with the UI before the patch and the changes after the patch is applied. The second section (Example to illustrate the change with a views based REST export json response) is applying the exact samebeforeand afterpattern. That way a user might assume thatbeforeshows the response without the patch applied whileaftershows the response with the patch applied. Instead thebeforeis the response for theRelative URLoption whileafteris the response for theAbsolut URLoption. Maybe the easiest fix might be to simply replacebeforeandafterwithRelative URLandAbsolute URL? The headline could be left as is even and I've used the slightly shortened example URLs from #138.Example to illustrate the change with a views based REST export json response:
Relative URL:
/sites/default/files/image.pngAbsolute URL:
https://www.example.com/sites/default/files/image.pngComment #140
joegl commentedI've applied the diff from the merge request on a 10.3.x site and it works great: https://git.drupalcode.org/project/drupal/-/merge_requests/5882.diff . I am using it in a REST View.
Comment #141
sokru commentedIn order to rebase the MR, @smustgrave needs to resolve the existing threads.
I changed the wording from recommendations on #138.1.
#138.2 Changing checkbox to radio button: This would require rewriting large part of the MR and tests.
#138.3: I would say its out of scope, since the dynamic functionality described does not exist yet in Drupal core.
Comment #142
mohit_aghera commentedI did tried to fix the feedback mentioned in the #138
I've attached a few screenshots about how it looks like on the backend.
Summary
Relative URL option and example test
Absolute URL option and example test
For now, i've pushed the changes related to modified files.
I'll keep an eye on tests and will address additional failures.
Hiding all the old patches and files to prevent the confusion.
Comment #143
mohit_aghera commentedComment #144
mohit_aghera commentedComment #145
mohit_aghera commentedComment #146
mohit_aghera commentedAddressed the feedback in #138
I'm slightly confused about changes proposed in #139 comment.
I have updated the change record screenshots so it is more useful.
Comment #147
mcgowanm commentedRe-rolled diff from MR 5882 for anyone else who still needs compatibility with PHP 8.1.
Comment #148
rkollerAt first sorry for the late reply. I've manually tested MR5882. From a functional perspective the MR looks fab. All the points we've raised in #138 look and work as suggested now. Thank you mohit_aghera!
In regards of #139 it took me a while to figure out what i meant back then and what the actual problem was I've tried to outline. Should have been clearer, apologies. :( My suggestion was, on https://www.drupal.org/node/3368703 you have "Example to illustrate the change with a views based REST export json response". After that you have
BeforeandAfterin bold. Those two titles/labels are misleading and probably mislabled. My suggestion simply was changeBeforetoRelative URLandAftertoAbsolute URL. And thanks for updating the images to the current state in the changelog.I leave the status at needs review cuz i am not qualified to provide a code level review and i've readded the usability tag since the issue is considered an usability improvement.
Comment #149
smustgrave commentedMR appears to need a rebase.
Comment #150
mohit_aghera commentedMR is green now.
There was one random failure, fixed that now.
We should be good to get the initial round of review.
Comment #151
rares petru samartean commentedI believe the patch in #147 doesn't allow the generation of image styles as it is not using the standard image style generation function. I found this which goes in detail https://www.unimitysolutions.com/insights/image-style-token-itok-and-drupal . I have this issue on my Drupal backend.
The issue seems to be that the link generated doesn't include the itok GET query value
Edit for clarity: I'm using a view set to the Pager Serializer view format of type JSON to list indexed node entities that contain the image field. The URL's that are outputted do not contain the itok, and if they are not already generated and present on the filesystem, they are not generated at runtime and accessing the image link returns in a 404.
For now, this can be set to get around the issue and continue using the patch:
Comment #152
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #153
needs-review-queue-bot commentedFalse positive
Comment #154
larowlanLeft some comments/questions on the MR
Comment #155
mohit_aghera commented@larowlan All the feedback mentioned in the PR is fixed now.
PR is green, I think it is ready for another round of review.
Comment #156
sagarmohite0031 commentedHello,
Tested and verified on Drupal 11,
MR applied successfully.
Option for both the field formatter added successfully.
Attaching before and after screenshots.
Comment #157
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #158
mrshowermanDid a rebase. Now there's a few phpstan errors again, maybe @mohit_aghera can look into them.
Comment #159
mohit_aghera commentedThanks for the rebase @mrshowerman
I've fixed the phpstan issues and PR is now green.
I think we are good to get another round of review since all the issues are addressed on the PR
Comment #163
smustgrave commentedAppears to be multiple MRs up and should be 1 against 11.x
Deprecation versions appear off.
Comment #165
sokru commented- I hid the 11.1.x branch
- I moved
show_link_aselement into trait. If we can think up something better name for "UrlSuggestionTrait" be could change it now.-
relativeUrlSuggestion()had absolute URL in #description, changed it to relative- Based on #138.2 and #138.3 I removed the unnecessary description text "If checked, links will be rendered as absolute URLs."
- I bumped the versions on deprecated message
Changing the status to "Needs review" although there's open questions from @larowlan
Comment #166
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #167
mrshowermanRebased an addressed the @larowlan's comment.
Test fail seems unrelated.
Comment #168
kim.pepperReviewed and added some feedback.
Comment #169
kim.pepperComment #170
mrshowermanComment #171
kim.pepperI'm seeing a few changes that look unrelated. You might need to rebase on 11.x?
Comment #172
mrshowermanNot sure which changes you're referring to, but I rebased anyway.
Comment #173
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #174
mrshowermanTests are green again.
Comment #175
kim.pepperI went through and resolved a load of old feedback threads that had been addressed, and did a final pass.
Looked at:
IMO this is ready.
Comment #177
omarlopesinoHi, this functionality works great. I think to complete this issue we should address the problem reported by #115 and #151 : the image styles are not accessible. This produces that when I access an absolute URL of a image style generated by the Image url formatter, the result is a 404 page.
In my case I reproduced with the latest version of the MR, having a private image field that has image styles.
I suggest going back to building the URL with image_style->buildUrl for image styles, and using fileUrlGenerator only to generate original image urls, and transforming the absolute url to relative.
Comment #178
omarlopesinoAdded this commit to support image styles URLs: https://git.drupalcode.org/project/drupal/-/merge_requests/5882/diffs?co...
Comment #179
omarlopesinoComment #180
omarlopesinoThe change is working and tests are passing. May somebody review the latest change, so we can move it back to RTBC? Thanks!
Comment #181
smustgrave commentedMR appears to have conflict.
Comment #182
sokru commentedMR rebased.
Comment #183
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #184
ironnuts commentedFixed merge conflict.
Comment #185
dcam commentedRestoring status.
Comment #186
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #187
dcam commentedRestoring the status.
Comment #188
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #189
dcam commentedComment #191
joelpittetI took the latest MR 5882 and created a 10.5.x patch, and took out the tests to avoid any other conflicts and rerolled
core/modules/file/file.post_update.phpdropping it here in case others need it.Comment #194
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #195
eescribanoc commentedPatch no longer applies to 11.3.2
Comment #196
dcam commentedI rebased it.
Comment #200
eescribanoc commentedI still have trouble with it, I have tried making new merge request but I was getting some weird behaviors.
I will add here the patch that works for 11.3.2
Comment #201
claudiu.cristeaAs I see initially it was a boolean but was changed to string in ab6b1d529 (note 336186) but I wonder why. Why is string better?
OK, I see the Usability Review from https://www.drupal.org/project/drupal/issues/2811043#comment-15387004 is recommending radio buttons, but still that doesn't stop us storing as boolean.
Comment #203
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #204
anybodyJust ran into this and agree it would be super helpful. Feedback from @claudiu.cristea should please get addressed to get this finished, see #201
Comment #205
rkollerAgreed, and MR5882 definitely needs a rebase at this point, plus three files have conflicts due to the fact that they were modified in the source and target branch according to gitlab.
Comment #208
mohit_aghera commentedI have reviewed all the open PRs and PR 5882 (https://git.drupalcode.org/project/drupal/-/merge_requests/5882/) seems to contain all changes.
I've hidden two other PR and visible patches to avoid clutter.
I've updated that with latest main branch and resolved all the conflicts.
@claudiu.cristea regarding your feedback at #201
Do you mean keeping two options each for Absolute and Relative or converting to a checkbox?
If we want to keep both options
'#options' => [0 => $this->t('Absolute'), 1 => $this->t('Relative')],, in that case the schema type of "show_link_as" shouldn't be integer?Comment #212
mxh commentedUpdated the branch at least to be mergeable again. Removed some PHPStan unmatched ignore patterns (not sure why it's related to this MR though). Couldn't do a simple rebase, could only merge in current main branch.
Open tasks for next needs review state: