Skip to content

Fix tooltip _position migration writes invalid empty string #370

Description

@swashbuck

Subject of the issue

The _tooltip._position migration writes an empty string '', which is not a valid value for the _position enum in the schema. Any course migrated through this step then fails modern-schema validation (for example when imported into the authoring tool). The bug is present on master (6.20.1).

Your environment

  • Framework 5.56.2, adapt-contrib-hotgraphic 6.20.1 (also present on master)
  • N/A (build-time migration, not browser)

Steps to reproduce

  1. Take a hotgraphic course authored before v6.13.1 (no _tooltip._position on items).
  2. Migrate it up through v6.13.1 (e.g. grunt migration:test --file=adapt-contrib-hotgraphic, or import into the authoring tool).
  3. Validate the migrated content against the current component schema.

Expected behaviour

After migration, each item's _tooltip._position should hold the schema default "bottom" (a valid enum value), so the content validates.

Actual behaviour

The v6.12.1 > v6.13.1 migration sets _tooltip._position to ''. _position was introduced in v6.13.1 already carrying an enum and a "bottom" default; '' is not a permitted value, so validation fails, e.g.:

/_items/0/_tooltip/_position must be equal to one of the allowed values

The migration's own checkContent passes only because it asserts the same invalid ''.

Suggested Fix (if known)

In migrations/v6.js, set _tooltip._position to the schema default 'bottom' in both the mutateContent ("add item _tooltip._position attribute") and the matching checkContent.


Posted via collaboration with Claude Code

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Needs Reviewing

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions