peer_reviewed_article: Featured image stored in the wrong place

Open
#627 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
javascript, xml
Domain
backend

Research direction

Read ensureStructure and editView to trace where the featured image element is created and stored in the XML. The issue leaves open whether to migrate existing data on save, add schema versioning and migrations, or document the structure, so first investigate the data format and the crash context in #519. Done means choosing and implementing a consistent storage approach that handles existing articles.

Written by the indexing model from the issue text.

Description

Impact: Low Level: Moderate Pagetype: Peer reviewed article Type: Bug Value: Coders

The ensureStructure method creates a FIELD_NAME_FEATURED_IMAGE below article/content, but the editView (and functions it calls) put the featured image directly below the root of the XML.

This means every article has an empty featured image element below context, and another one at the root, which potentially causes crashes (see #519), but also needs to be fixed somehow.

Maybe some migration approach (on save? Or we need to add schema versioning and active migrations). Or accept that this datastructure is weird and document it?

Dominant language
JavaScript
Stars
5
Forks
9
Avg merge
18h 49m
Merged PRs (30d)
13

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PlanBCode/hypha

All issues in PlanBCode/hypha

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.