- Issue created by @tregonia
- π³π±Netherlands Lendude Amsterdam
Dropbutton uses \Drupal\views\Plugin\views\field\Links::getLinks to make it's links and it does seem to have some of its own handling for rewrites, so that is probably where it breaks
- π³π±Netherlands Lendude Amsterdam
Took another look.
The dropbutton render element expects links in the following format
[ 'url' => $path ? UrlObject::fromUri('internal:/' . $path) : $url, 'title' => $title, ]
So we can't pass it a fully rendered Views field, all the logic in AdvancedRender would needs to be redone in the Dropbutton plugin to format it in a way that works for a dropbutton.
In other words, the Dropbutton field in its current form is meant for simple implementations only.I understand that this feel like a bug, and will leave it open as such, but it's close to being 'Works as designed'
- π§πͺBelgium kristiaanvandeneynde Antwerp, Belgium
Just got bitten by this too.
Had a few manually crafted links (global text rewritten as link). It works while showing the links in the view directly, but when you hide them and put them in the dropbutton, they lose the first part of their path because of the code linked in #5. The hard-coded forward slash gets prefixed to the one coming from the link, leading to an internal url like
internal://node/1
, which makes pares_url() think the host is "node" and the path is "/1"Not sure how you could consider this working as designed, though :) At least we could check if $path starts with a forward slash and strip that before feeding it into
UrlObject::fromUri('internal:/' . $path)
? - Merge request !13133Issue #3381968 by tregonia, lendude, kristiaanvandeneynde: URL output via... β (Open) created by kristiaanvandeneynde
- π§πͺBelgium kristiaanvandeneynde Antwerp, Belgium
There we go, easy fix and confirmed to work on my end. Let's see what tests have to say. Also might need a test to confirm it works and keeps working.
- πΊπΈUnited States smustgrave
Could we add a test assertion for this one. Maybe FieldEntityLinkBaseTest?