Skip to content

Fix: Menu background image lost at extra large screen sizes after migration (fixes #244) - #245

Merged
oliverfoster merged 2 commits into
masterfrom
issue/244
Oct 7, 2026
Merged

oliverfoster merged 2 commits into
masterfrom
issue/244

Conversation

@swashbuck

@swashbuck swashbuck commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #244

Fix

  • The migration that added the extra large background image option now carries the existing large image across instead of blanking it, so courses keep their menu background on screens 1280px and wider. The same applies to the menu header background image.
  • The two checks now confirm a populated large image was actually carried over, rather than asserting the new value is empty. The previous checks passed precisely because they expected the empty value, which locked the behaviour in.
  • Added a test case using populated content. Every existing fixture uses empty objects, which is why this was not picked up.
  • Removed a stray quote from the framework version in every updatePlugin call across the migrations. All six were affected, so a migrated course was being given a malformed range such as ">=5.24.2 instead of >=5.24.2. The corrected values match the framework fields in the corresponding releases.

Testing

Full migration suite passes (23 tests). Reverting only the change to the two mutate steps, while keeping the new check and test, makes the suite fail — so the new test genuinely exercises the fix rather than passing regardless.

Migrating a course that sets a menu background image gives:

before   _large="menu-lg.jpg" _xlarge=""            renders ""
after    _large="menu-lg.jpg" _xlarge="menu-lg.jpg" renders "menu-lg.jpg"

Notes

Found while reviewing adaptlearning/adapt-contrib-vanilla#616, which had the same problem in its new migration scripts.

adapt-contrib-languagePicker uses the same breakpoint fallback but is not affected — there the background image and the extra large option arrived in the same release, so there is never an earlier large value to carry over.

Posted via collaboration with Claude Code

@swashbuck
swashbuck requested a review from taylortom August 25, 2026 22:05

@oliverfoster oliverfoster left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brad, a man whose calm under pressure is the stuff of quiet legend.

Migration suite passes on this branch (23/23, via grunt migration:test --file=adapt-contrib-boxMenu). The new populated-content case carries _large into _xlarge for the course, menu header and sub-menu backgrounds.

The ">= → >= fixes to the updatePlugin framework ranges look right.

@oliverfoster
oliverfoster merged commit fe1e62e into master Oct 7, 2026
@oliverfoster
oliverfoster deleted the issue/244 branch October 7, 2026 14:32
github-actions Bot pushed a commit that referenced this pull request Oct 7, 2026
## [7.7.1](v7.7.0...v7.7.1) (2026-10-07)

### Chore

* README metadata (fixes #240) #241 ([a431941](a431941)), closes [#240](#240) [#241](#241)

### Fix

* Menu background image lost at extra large screen sizes after migration (fixes #244) (#245) ([fe1e62e](fe1e62e)), closes [#244](#244) [#245](#245) [#244](#244)
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 7.7.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix menu background image lost at extra large screen sizes after migration

2 participants