-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Milestone
Description
NetBox Edition
NetBox Community
NetBox Version
v4.4.1
Python Version
3.11
Steps to Reproduce
- Open the contacts view of any device (/dcim/devices/xxx/contacts)
- Use "Configure Table" to add the "Group" column
- Click "GROUP" to sort by Contact Group
- this does not work reliably, it seems sometimes it is rendered with
href=""instead ofhref="#" - alternatively manually add the query parameter
?sort=contact_group
- this does not work reliably, it seems sometimes it is rendered with
Note that whilst reproduced and reported against the latest version of NetBox at the time of writing, the problem was already observed with earlier versions.
Expected Behavior
- No error should be returned, the list of contacts should be sorted by contact group.
- The broken preference should not be persisted into the database.
Observed Behavior
FieldError at /dcim/devices/37122/contacts/
Cannot resolve keyword 'group' into field. Choices are: address, assignments, bookmarks, comments, created, custom_field_data, description, email, groups, id, journal_entries, last_updated, link, name, phone, subscriptions, tagged_items, tags, title
Find the traceback here.
Worse, the user is now locked out from loading the /contacts view, as the problem was also written into the database:
SELECT users_userconfig.id, data->'tables'->'ContactAssignmentTable' AS x FROM users_userconfig INNER JOIN users_user ON users_user.id = user_id WHERE username = 'myuser';
1|{"columns": ["object_type", "object", "contact", "role", "priority", "contact_email", "contact_phone", "contact_group"], "ordering": ["contact_group"]}
To "repair" the user, an administrator needs to manually remove the offending entry from the JSON (as there is only one entry in the list, I just delete the whole ordering key for simplicity):
UPDATE users_userconfig SET data = data #- '{tables, ContactAssignmentTable, ordering}' WHERE id = 1;
UPDATE 1
This lasts until the user clicks "GROUP" again. ;-)
Metadata
Metadata
Assignees
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application