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

Disallow the use of double underscores in a custom field name #12468

Closed
JonasEinfach opened this issue May 4, 2023 · 5 comments · Fixed by #12523
Closed

Disallow the use of double underscores in a custom field name #12468

JonasEinfach opened this issue May 4, 2023 · 5 comments · Fixed by #12523
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@JonasEinfach
Copy link

JonasEinfach commented May 4, 2023

NetBox version

v3.5.0

Python version

3.8

Steps to Reproduce

  1. Create Custom Field --> Type: Object (Location), Assigned Models: ipam | VLAN
  2. Go to IPAM --> Vlans --> Edit Vlan and chose Location Object by custom Field
  3. In the Vlans overview chosed location not showing, if you click on the specific vlan the location is showing
  4. Same behavior if you assign the custom field to other models like ipam | ip addresses

Expected Behavior

Location from custom Field should be shown in vlan overview

Observed Behavior

Location from custom Field no shown in vlan overview
Netbox_Location_not_show

Location from custom Field only show if you click on the vlan
Netbox_Location_show_in_vlan

@JonasEinfach JonasEinfach added the type: bug A confirmed report of unexpected behavior in the application label May 4, 2023
@kkthxbye-code kkthxbye-code added the status: revisions needed This issue requires additional information to be actionable label May 4, 2023
@kkthxbye-code
Copy link
Contributor

Cannot replicate this, it seems likely that you added the wrong column to the table. Please revise your replication steps.

My test:

image

image

@JonasEinfach
Copy link
Author

I create another custom Field with another Name and it works.

If I delete the Custom Field Test__Location and recreate the Field with the same Name, I have the same Issue.
Maybe the Name Test__Location trigger anything. Very Strange behaviour.

I would close the bug. Thank you for your time.

@jeremystretch
Copy link
Member

I notice that you're using two underscores in the custom field name. This is likely the issue: The table is interpreting the double underscore as a relationship (i.e. test.location) rather than a single field name. Try using a single underscore.

@jeremystretch jeremystretch added status: under review Further discussion is needed to determine this issue's scope and/or implementation and removed status: revisions needed This issue requires additional information to be actionable labels May 4, 2023
@JonasEinfach
Copy link
Author

Perfect, thank you!

@jeremystretch
Copy link
Member

We should probably prevent the use of double underscores in a custom field name to prevent this issue.

@jeremystretch jeremystretch changed the title Custom Field Type Object - DCIM Location not displayed in Overview Disallow the use of double underscores in a custom field name May 8, 2023
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels May 8, 2023
@arthanson arthanson self-assigned this May 8, 2023
@arthanson arthanson removed the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label May 8, 2023
@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label May 12, 2023
jeremystretch added a commit that referenced this issue May 15, 2023
jsenecal pushed a commit to jsenecal/netbox that referenced this issue May 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants