Closed (outdated)
Project:
Drupal core
Version:
8.9.x-dev
Component:
views.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Aug 2015 at 08:31 UTC
Updated:
24 Dec 2019 at 07:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dawehnerMeh :)
Comment #3
lauriiiComment #5
calebtr commentedI came looking for this because I was seeing a similar error as https://www.drupal.org/node/2488540.
So other folks can find this issue, the error message is:
InvalidArgumentException: The internal path component 'http://...' is external. You are not allowed to specify an external URL together with internal:/. in Drupal\Core\Url::fromInternalUri() (line 430 of .../core/lib/Drupal/Core/Url.php).
In my use case, I'd like a block view of aggregator feed items to have a 'more' link that goes to the original source. I solved it, temporarily, with an Apache redirect from an internal path, which is not ideal.
It seems like this is part of the much bigger problem of views applying its own rules for how users enter urls. I looked and haven't found an issue for that yet. If this issue is worth working on, where to start?
Comment #10
racinggrinner commented+1 To get this fixed. Also fails to link to arguments such as: /resources/library?field_resource_type_target_id=43
Comment #11
cellar door commentedRan into this one as well and found a quick and easy fix to check if it's external url via starting with http. I'm sure there are other tests etc. that will need to be eventually written but for anyone wanting a patch here you go.
Comment #12
dawehnerHow about using
\Drupal\Component\Utility\UrlHelper::isExternalinstead?Comment #13
shane birley commentedI just ran into this creating an XML feed using Views. The error appears when attempting to view the feed. Incredibly odd.
Comment #15
nightlife2008 commentedI recreated the patch using the UrlHelper function.
Comment #16
nathan tsai commentedAlong with @ShaneBirley, I've also encountered this while trying to make an RSS feed.
Comment #18
chaquea commentedRolling against 8.7 based on #15
Comment #19
idebr commentedClosed #3062542: Views 'More Link' not allowing external links as a duplicate issue.
Comment #20
lendudeWe have a patch, so lets see what the TestBot makes of this, but this still needs a test.
Comment #21
yogeshmpawarComment #22
yogeshmpawarResolved coding standard issue & added an interdiff.
Comment #23
daffie commentedThere is an automated test needed. The fix looks good to me!
Comment #24
daffie commentedFor the comitter: please give credit to @evanjenkis and @boazpoolman. There patches are older then the patches from this issue. See: #2806751: More link external URL errors out.
Comment #26
chaquea commentedPatch 2556349-22.patch does not apply to core 8.8.1, but it seems like this was implemented into core already?
core/modules/views/src/Plugin/views/display/DisplayPluginBase.php (line 2127)
$url = UrlHelper::isExternal($path) ? Url::fromUri($path, $options) : Url::fromUserInput('/' . ltrim($path, '/'), $options);
Comment #27
lendudeYup this got fixed in #564106: More links pointing to custom URLs don't respect entered fragments and query parameters, this should have been closed as a duplicate of that :(
Thanks for working on this anyway!