Using _customRouteId for a button is broken if a valid model cannot first be found for the type. For example, if there is no "next" sibling content object in a menu group and you set the _customRouteId to the first content object in the next group, the button will not be shown.
When the code goes through and gets the valid models (e.g. get the next sibling content object for the _next button model), it will exit if no model is found.
Subject of the issue
Using
_customRouteId
for a button is broken if a valid model cannot first be found for the type. For example, if there is no "next" sibling content object in a menu group and you set the_customRouteId
to the first content object in the next group, the button will not be shown.When the code goes through and gets the valid models (e.g. get the next sibling content object for the
_next
button model), it will exit if no model is found.https://github.com/cgkineo/adapt-pageNav/blob/330a72b5bdeb2a843efa1e98e60aed169c07fd9f/js/PageNavModel.js#L45-L46
So, it never gets a chance to check for a
_customRouteId
:https://github.com/cgkineo/adapt-pageNav/blob/330a72b5bdeb2a843efa1e98e60aed169c07fd9f/js/PageNavModel.js#L48-L50
Your environment
Steps to reproduce
Set up a menu with grouping. Each group contains one topic:
For the
_next
button in co-100, set the_customRouteId
toco-200
since it can't naturally find what the next content object is.For the
_previous
button in co-200, set the_customRouteId
toco-100
since it can't naturally find what the previous content object is.Expected behaviour
The Next button in co-100 and the Previous button in co-200 should both be visible.