Repository navigation
Read current ResourceXResource keys in the related resources manager - #13068
Open
rayondemiel wants to merge 1 commit into
Open
rayondemiel wants to merge 1 commit into
rayondemiel wants to merge 1 commit into
Conversation
ResourceXResource renamed nodeid, tileid and resourceinstanceidfrom to node, tile and from_resource in 8.0 (archesproject#11869) and dropped datestarted and dateended, but the related resources manager still read the old keys: parse() threw "nodeid is not a function" on the first relationship, so no relationship or paginator was shown, and opening a relationship's panel failed on resourceinstanceidfrom(). Keep the node id under nodeid before node becomes the name/class holder, read tile() and from_resource(), and drop the date fields the server no longer stores. Saving a relationship now also ends the loading state. Investigation and patch prepared with Claude Code (Anthropic); reviewed and tested by the contributor.
rayondemiel
force-pushed
the
fix/related-resources-manager-keys-8.1
branch
from
October 27, 2026 14:57
c18168b to
4dad59e
Compare
3 of 11 tasks
rayondemiel
marked this pull request as ready for review
October 27, 2026 20:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Types of changes
Description of Change
Since 8.0 the related resources manager cannot list a resource's relationships:
parse()fails withUncaught TypeError: relationship.nodeid is not a functionon the first relationship, so neither the list nor the paginator appears. Opening a relationship's panel then fails onrelationship.resourceinstanceidfrom(), and saving a relationship leaves the spinner running.ResourceXResourcefields were renamed in 8.0 (#11869:nodeid→node,tileid→tile,resourceinstanceidfrom→from_resource;datestarted/dateendedremoved) andResource.get_related_resourcesserialises them withmodel_to_dict, so the payload carries the new names. #11986 updated the consumers forto_resource/from_resource, but the manager and its template kept the other old keys.This PR:
relationship.nodeid(the manager replacesrelationship.nodewith the holder of the node's name and ontology class right after mapping);relationship.tile()andrelationship.from_resource()in the JS and the template;RelatedResourcesView.postreadsrelationshiptypeandnotesonly);The payload is unchanged; the other consumers (
models/report.js, the related-resources graph, the report API) already read the new keys.Reproduced and tested on 8.1.5 with a resource holding 1,652 relationships: the list and its 111 pages are shown, the relationship panel opens, a relationship type is saved and the spinner stops.
Investigation and patch prepared with Claude Code (Anthropic); reviewed and tested by the contributor.
Issues Solved
No issue opened.
Checklist
tile,nodeandfrom_resourcekeys the manager reads. The failing side is Knockout, which has no unit-test harness in Arches, so the test guards the contract rather than failing on the target branch.Ticket Background
Further comments
Alternative considered: adding the old names back to the relation dicts in
get_related_resources. Rejected: it would reintroduce as duplicates the names 8.0 removed, and #11986 set the precedent of moving the JS to the model field names. The same bug is present on dev/8.2.x.