- πΊπΈUnited States sandrymend
Adding this patch to make consistent absolute URLs to channel content.
- Status changed to Needs review
over 1 year ago 5:12am 28 July 2023 - πΊπΈUnited States dww
Moved the example View into an attached file. This issue was almost impossible to read for anyone with all that inline code at the top. π Scrolling on a phone would have been extremely painful, and I can only imagine the horror of landing here with a screen reader. π¬
Hopefully this issue is now easier for everyone to contribute to, since I agree this is a bug we should fix.
Since there's a patch in #2, moving to Needs review.
Thanks!
-Derek - Status changed to Needs work
over 1 year ago 8:21pm 16 August 2023 - πͺπΈSpain rodrigoaguilera Barcelona
The approach seems right.
I prefer if you inject just the request stack and make the constructor more simple.
Here are some reasons why that way is better:
https://mglaman.dev/blog/dependency-injection-anti-patterns-drupal - πΊπΈUnited States dww
Hah, funny timing. I was just looking at this issue again.
I'm not sure I love hard-coding the request stack host and port like that.
It wouldn't handle it when a string actually does start as absolute (for whatever reason).
It won't consistently work for sites installed in subdirectories.I think converting the value to a
Url
object and setting it to be absolute is safer.Also means we don't have to mess with any DI changes at all.
Thoughts?
-Derek - Status changed to Needs review
over 1 year ago 8:33pm 16 August 2023 - πΊπΈUnited States dww
Probably scope creep, but I noticed that the channel image handling is like so:
$image_url = ( UrlHelper::isExternal($image_field_value) ? $image_field_value : \Drupal::request()->getSchemeAndHttpHost() . $image_field_value ); $parsed_image_field = parse_url($image_url); ...
Seems like we probably want to clean all this up to just use a
Url
object, too. Should that happen as part of this issue, or would the maintainers prefer handling that as a follow-up?Thanks,
-Derek - πͺπΈSpain rodrigoaguilera Barcelona
I think using the Url object is better so if you want to go ahead with that change I will commit it along this.
- Status changed to Needs work
9 months ago 1:41pm 1 April 2024 - πͺπΈSpain pcambra Asturies
Setting to the right state, I've changed code around this in other issues so probably a rebase is needed.