You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The nav tag includes a from parameter that is documented as, "If unspecified, it'll start from the top."
However, it will return everything even if from is specified but empty or nonsensical.
The from parameter is supposed to accept "the URI of the entry to be used as the starting point for your navigation". But when supplied with a non-existent URI, such as "bob", it will still return everything. Specifying a non-existent URI is not "unspecified." For example, the URI may have once existed and been changed. In such cases it is unlikely that the artisan expects "everything" to suddenly be returned. In fact, this behavior makes bugs harder to discover, since at a glance stuff is being returned. It would be much easier to notice that the value supplied was not a valid URI if it returned empty.
It is correct for the actually unspecified default behavior to return everything, this is a good default.
But it is a problem for every specified value that is not a URI to also return everything.
How to reproduce
Add the following code to your default template...
Bug description
The
nav
tag includes afrom
parameter that is documented as, "If unspecified, it'll start from the top."However, it will return everything even if
from
is specified but empty or nonsensical.The
from
parameter is supposed to accept "the URI of the entry to be used as the starting point for your navigation". But when supplied with a non-existent URI, such as "bob", it will still return everything. Specifying a non-existent URI is not "unspecified." For example, the URI may have once existed and been changed. In such cases it is unlikely that the artisan expects "everything" to suddenly be returned. In fact, this behavior makes bugs harder to discover, since at a glance stuff is being returned. It would be much easier to notice that the value supplied was not a valid URI if it returned empty.It is correct for the actually unspecified default behavior to return everything, this is a good default.
But it is a problem for every specified value that is not a URI to also return everything.
How to reproduce
Add the following code to your default template...
Notice that even if you have no URI "bob" you will get all your pages in the result.
Logs
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: