Description
Version: 3.0.4
Links with destination in deprecated/invalid format
:Module:Presenter:action
(note the semicolon :
at the beginning of the destination string)
work with UI\Presenter
/UI\Component
but not with LinkGenerator
.
I'm not sure which one is the desired behaviour, or whether this is a bug of UI\Component
or LinkGenerator
class, but in the following scenario, only the first call works:
$presenter->link(':Foo:Bar:'); // works ✔
$linkGnrtr->link(':Foo:Bar:'); // fails ❌
The second call fails with Presenter name must be alphanumeric string, ':Foo:Bar' is invalid.
.
Links in the correct format work with both classes, of course ✔:
$presenter->link('Foo:Bar:'); // works ✔
$linkGnrtr->link('Foo:Bar:'); // works ✔
I understand that the format is not correct according to current documentation, but I would like to point out that the behaviour should be consistent, that is,
it should either work in both cases or not work in either one.
EDIT:
I forgot to add that calling
$presenter->getAction(true);
will result in (depending on whether the presenter is in a module or not)
':Foo:Bar:default' // inside a module
':Bar:default' // outside a module
... which is in direct contradiction to the format, as in the methods' comments:
@param string $dest in format "[[[module:]presenter:]action] [#fragment]"