Closed ArnoMoqo closed 2 months ago
I tend to agree that linking to an element that isn't available seems odd behaviour. I suppose this is a somewhat breaking change, so keen to know if others have thoughts about the desired behaviour.
I tend to agree that linking to an element that isn't available seems odd behaviour. I suppose this is a somewhat breaking change, so keen to know if others have thoughts about the desired behaviour.
Maybe adding a new property link.isEnabled
could also be a solution, than there is no breaking change for other users.
Bit the bullet and just changed the behaviour of isEmpty
for element links. To get this early, run composer require verbb/hyper:"dev-craft-4 as 1.1.32"
or composer require verbb/hyper:"dev-craft-5 as 2.0.2"
.
What are you trying to do?
I would think when using
link.isEmpty()
Hyper would also check if the element is enabled. Right now, when you link to an entry, and you disable the entry there would still be an active Hyper link, linking to a 404 page since the page is no longer available.What's your proposed solution?
Make
link.isEmpty()
returntrue
when an disabled element is selected.Additional context
Don't know if there are or gone be technical issues involved in this. Happy to discuss it.