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
The /repositories/:repo_id/classification_terms/:id/parent
endpoint returns a 500 error
#1384
Comments
I was getting a different, but similar, 500 error that no longer happened after upgrading to v2.5.2 (and rebuilding indexes). |
@smoore4moma I just retried my steps and I am still getting this same issue, using v2.5.2. Looking at the code on the master branch, it appears that the https://github.com/archivesspace/archivesspace/blob/master/backend/app/model/classification_term.rb Using a python client for ArchivesSpace: import aspace
client = aspace.client.ASpaceClient('http://localhost/test_aspace/api')
client.authenticate()
### <Response [200]>
client.get('/')
### <Response [200]>
client.get('/').json()
### {'databaseProductName': 'MySQL', 'build': 'java1.7', 'ruby_version': '2.3.0', 'databaseProductVersion': '5.7.25', 'host_os': 'linux', 'archivesSpaceVersion': 'master', 'host_cpu': 'x86_64'}
client.get('/repositories/2/classification_terms/1')
### <Response [200]>
client.get('/repositories/2/classification_terms/1').json()
### {'repository': {'ref': '/repositories/2'}, 'display_string': 'Classification Term 2', 'user_mtime': '2019-05-08T17:21:07Z', 'system_mtime': '2019-05-08T17:21:07Z', 'title': 'Classification Term 2', 'lock_version': 0, 'identifier': '2', 'uri': '/repositories/2/classification_terms/1
### ', 'position': 0, 'created_by': 'admin', 'path_from_root': [{'identifier': 'Test', 'title': 'Test'}, {'identifier': '2', 'title': 'Classification Term 2'}], 'linked_records': [], 'jsonmodel_type': 'classification_term', 'publish': True, 'last_modified_by': 'admin', 'classification'
### : {'ref': '/repositories/2/classifications/1'}, 'create_time': '2019-05-08T17:21:07Z'}
client.get('/repositories/2/classification_terms/2').json()
### {'repository': {'ref': '/repositories/2'}, 'display_string': 'Classification Term 1', 'user_mtime': '2019-05-08T17:21:15Z', 'system_mtime': '2019-05-08T17:21:15Z', 'title': 'Classification Term 1', 'lock_version': 0, 'identifier': '1', 'uri': '/repositories/2/classification_terms/2
### ', 'position': 1, 'created_by': 'admin', 'path_from_root': [{'identifier': 'Test', 'title': 'Test'}, {'identifier': '1', 'title': 'Classification Term 1'}], 'linked_records': [], 'jsonmodel_type': 'classification_term', 'publish': True, 'last_modified_by': 'admin', 'classification'
### : {'ref': '/repositories/2/classifications/1'}, 'create_time': '2019-05-08T17:21:15Z'}
client.post('/repositories/2/classification_terms/1/parent?parent=0&position=0').json()
### {'error': "super: no superclass method `update_position_only' for #<ClassificationTerm:0x5d7b3e2f>\nDid you mean? update_only"}
client.post('/repositories/2/classification_terms/1/parent?parent=0&position=1').json()
### {'error': "super: no superclass method `update_position_only' for #<ClassificationTerm:0x36952f42>\nDid you mean? update_only"}
client.post('/repositories/2/classification_terms/1/parent?parent=1&position=1').json()
### {'error': "super: no superclass method `update_position_only' for #<ClassificationTerm:0x567a0505>\nDid you mean? update_only"}
client.post('/repositories/2/classification_terms/1/parent?parent=2&position=1').json()
### {'error': "super: no superclass method `update_position_only' for #<ClassificationTerm:0x654bb276>\nDid you mean? update_only"}
client.post('/repositories/2/classification_terms/1/parent?position=1').json()
### {'error': "super: no superclass method `update_position_only' for #<ClassificationTerm:0x5fa40cb9>\nDid you mean? update_only"}
client.post('/repositories/2/classification_terms/1/parent?position=2').json()
### {'error': "super: no superclass method `update_position_only' for #<ClassificationTerm:0x41a6d2d2>\nDid you mean? update_only"}
client.post('/repositories/2/classification_terms/1/parent?position=0').json()
### {'error': "super: no superclass method `update_position_only' for #<ClassificationTerm:0x1e0cadba>\nDid you mean? update_only"}
client.post('/repositories/2/classification_terms/1/parent?parent=0').json()
### {'error': "super: no superclass method `update_position_only' for #<ClassificationTerm:0x2cb7d18b>\nDid you mean? update_only"}
client.post('/repositories/2/classification_terms/1/parent?parent=1').json()
### {'error': "super: no superclass method `update_position_only' for #<ClassificationTerm:0x5cc69f2c>\nDid you mean? update_only"}
client.post('/repositories/2/classification_terms/1/parent?parent=2').json()
### {'error': "super: no superclass method `update_position_only' for #<ClassificationTerm:0x1e1416e7>\nDid you mean? update_only"}
### Could you post screenshots of this endpoint working in your environment? |
Sorry. Wish I could help, but we actually do not have any classification terms defined and I only have prod to query. And we are on Windows. Just FYI. /repositories/2/classification_terms/0 |
…/parent endpoint
Issue #1384: Use correct method for classification_terms/parent endpoint
I'm trying to use the
/repositories/:repo_id/classification_terms/:id/parent
endpoint of the API to reorder some classification terms. It seems like every POST to this endpoint triggers a 500 error, with the text:It looks like the
update_position_only
method attempts to call theupdate_position_only
method of the super-class, which does not contain anupdate_position_only
method.Stack Trace
archivesspace/backend/app/controllers/classification_term.rb
Line 28 in 0814a9b
archivesspace/backend/app/controllers/classification_term.rb
Line 39 in 0814a9b
archivesspace/backend/app/model/classification_term.rb
Line 79 in bc675bc
Environment
Although, I don't think the version matters, because the git-blame says that the method has remained unchanged since it was added 6 years ago.
The text was updated successfully, but these errors were encountered: