Skip to content

Suspected bug with adding annotations to existing AnnotationPage #194

@glenrobson

Description

@glenrobson

If I wanted to add an annotation to an existing annotationPage I could call the add_annotation method as follows:

canvas.make_annotation(id=f"{URI_PRIFIX}/{identifier}", 
                                               motivation="supplementing", 
                                               target=c.id, 
                                               anno_page_id=annotationPageId,
                                               body={"id": f"https://archive.org/download/{identifier}/{vttFile['name']}",
                                                     "type": "Text",
                                                    "format": "text/vtt",
                                                    })

The first time this will happen it will create a new annotation page with the correct id. The second time I try and add an annotation to this page it will add it to the first annotationPage:

anno_page = self.annotations[0]

rather than searching through the annotaiton pages looking for the one that matches the ID.

Expected behaviour:

When passing in a annotationPage id the code should find that annotaiton page if it exists and add the annotation to the correct page.

Observed behaviour:

Untested but if the canvas already has a annotationPage then the annotaiton will be added to the first annotation page.

Potential bug location(s):

anno_page = self.annotations[0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions