Is scope missing the language path prefix (and base_url)?

Created on 2 March 2023, over 1 year ago
Updated 21 August 2023, about 1 year ago

Problem/Motivation

I'm writing this issue as a question for now, as I'm not totally (but 90%) sure that scope in the manifest and serviceworker-load.js has to take the language path prefix (e.g. /en/, /de/, ... )into account on multilanguage sites!?

This is the drupalSettings.path JS variable on a multilanguage project:

Still I'm not sure how to retrieve it in PHP the correct way to both work in single- and multilanguage environments.

Additional point:
Do we furthermore have to prefix the URL with base_path()?

The difference is, that the static base path at least *could* be added to the scope input field by the user, while the language path prefix is dynamic and changing by URL. So I don't think it can.

Setting priority to major as this bug might break PWA on multilanguage projects without noticing.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024