Problem/Motivation

The existing Ratio setting has no effect because the module passes it as plyr.ratio, while the GLightbox library expects plyr.config.ratio. This affects both explicitly configured ratios and leaving the setting blank for automatic sizing.

Steps to reproduce

  1. Go to /admin/config/media/glightbox.
  2. Set Ratio to 4:3, save and clear caches.
  3. Open a video in GLightbox.

Expected: the configured ratio is used. Actual: the setting is ignored and the library retains its default configuration.

Proposed resolution

Correct the configuration path in GLightboxAttachment::attach(). Add a Kernel regression test covering blank, landscape and portrait settings.

Remaining tasks

Review the merge request.

User interface changes

The existing Ratio setting works as described. No new settings.

API changes

The attached JavaScript setting moves from plyr.ratio to plyr.config.ratio.

Data model changes

None.

AI-Generated: Yes (Used Codex to help investigate and prepare the change.)

Issue fork glightbox-3630937

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nick hope created an issue. See original summary.

nick hope’s picture

Assigned: nick hope » Unassigned
Status: Active » Needs review
nick hope’s picture

Issue summary: View changes

  • nick hope committed 78e63ae4 on 1.0.x
    fix: #3630937 Honor the configured video aspect ratio
    
    By: NickHope
    
levmyshkin’s picture

Thank you, merged!

levmyshkin’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

levmyshkin’s picture

Status: Fixed » Closed (fixed)