Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using _customRouteId in grouped topics is broken #69

Closed
swashbuck opened this issue Jun 20, 2024 · 0 comments · Fixed by #70
Closed

Using _customRouteId in grouped topics is broken #69

swashbuck opened this issue Jun 20, 2024 · 0 comments · Fixed by #70
Assignees
Labels

Comments

@swashbuck
Copy link
Contributor

swashbuck commented Jun 20, 2024

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.

let buttonModel = buttonTypeModels[type];
if (!buttonModel) continue;

So, it never gets a chance to check for a _customRouteId:

// Find buttonModel from config._customRouteId if not found in defined type
if (buttonConfig._customRouteId) {
buttonModel = data.findById(buttonConfig._customRouteId);

Your environment

  • FW 5.39.7
  • Page Nav 3.1.4

Steps to reproduce

Set up a menu with grouping. Each group contains one topic:

  • Group 1 - co-100
  • Group 2 - co-200

For the _next button in co-100, set the _customRouteId to co-200 since it can't naturally find what the next content object is.

For the _previous button in co-200, set the _customRouteId to co-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.

@swashbuck swashbuck added the bug label Jun 20, 2024
@swashbuck swashbuck self-assigned this Jun 20, 2024
github-actions bot pushed a commit that referenced this issue Jun 25, 2024
## [3.1.5](v3.1.4...v3.1.5) (2024-06-25)

### Fix

* Prevent _customRouteId from being ignored, allow hidden content objects (fixes #68 #69) ([7182f8f](7182f8f)), closes [#68](#68) [#69](#69)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant