-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Array data source in the path of another can result in golang Panic #4366
Labels
Comments
This was referenced Feb 1, 2018
vassudanagunta
changed the title
Two array data sources at the same level results in golang Panic
Second array data source can result in golang Panic
Feb 3, 2018
vassudanagunta
changed the title
Second array data source can result in golang Panic
Array data source in the path of another can result in golang Panic
Feb 3, 2018
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When two source data files at the same level in the Site.Data tree contain array data at the top level, such as the following:
themes/mytheme/data/a/b1.json
:data/a/b1.json
:...the following error occurs:
The expected behavior is that
Site.Data.a.b1
=["1", "2", "3"]
The culprit is the
Site.handleDataFile(...)
insite.go
, in which the following section of code checks for pre-existing data at a node in the tree and incorrectly assumes it is a map node:hugo/hugolib/site.go
Lines 815 to 817 in 19e26cb
This is a pre-existing bug that goes back to at least 2015.
Add the following test to
datafiles_test.go
to uncover (and cover) this case:(bug uncovered while investigating #4361.
The text was updated successfully, but these errors were encountered: