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

fix board lookup for layer names with / #1727

Closed
gavin-ts opened this issue Nov 13, 2023 · 1 comment · Fixed by #1725
Closed

fix board lookup for layer names with / #1727

gavin-ts opened this issue Nov 13, 2023 · 1 comment · Fixed by #1725

Comments

@gavin-ts
Copy link
Contributor

gavin-ts commented Nov 13, 2023

"x.a" -> "y / b"

object ids can contain / so board lookup needs to account for this, passing the path as []string would be better.

If / is a valid character in layer names, wouldn't it also break this existing code?

// boardPath comes in the form of "x/layers/z/scenarios/a"
// or "layers/z/scenarios/a"
// or "x/z/a"
func (d *Diagram) GetBoard(boardPath string) *Diagram {
	path := strings.Split(boardPath, string(os.PathSeparator))
	if len(path) == 0 || len(boardPath) == 0 {
		return d
	}

If so, it seems like a bug.

Originally posted by @landmaj in #1725 (comment)

@landmaj
Copy link
Contributor

landmaj commented Nov 14, 2023

I fixed this in #1725

@github-project-automation github-project-automation bot moved this to Done in D2 Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants