- Issue created by @MacSim
- Status changed to Closed: won't fix
10 months ago 10:51am 8 February 2024 - 🇩🇪Germany Grevil
Thanks for taking the time, to write this summary! I don't see this as a PWA issue, but more of an issue of synchronizing dev and prod environments in Drupal (and probably in general).
Instead of deleting the users file and overwriting the pwa.config in your settings.php, just simply export your config, overwrite the "pwa.config.yml" image IDs with the ones you actually want and reimport it again.
And there's absolutely no check to see if the file is used somewhere else on the website => the file is physically deleted from the server leading to a missing image on the content where this file has been added by the contributor.
We could check file usage in the validationForm() method, but I doubt that is needed, as the files should only ever be used as the app icons.
- Status changed to Needs work
10 months ago 7:21pm 8 February 2024 - 🇫🇷France MacSim
I am sorry I am reopening this issue cause it's a major problem in this module architecture.
In 14 years using drupal it's the first time that I have such a problem... so it clearly sounds like a PWA issue.
Storing a fid value based on an upload which is happening on a single environment (the file doesn't even exist on other environment) as a config value which can be deploy in many environments doesn't make sense at all.You could store paths instead or ask people to respect some paths you're asking for with specific dimensions.
People would respect it cause if they don't their icons wouldn't work.Please have a look on how favicons and logos config are managed in
system.theme.global.yml
This is exactly how you should manage your PWA icons.We could check file usage in the validationForm() method, but I doubt that is needed, as the files should only ever be used as the app icons.
The summary I wrote however explains the opposite...
- First commit to issue fork.
- 🇩🇪Germany Duwid
@macsim I agree that this is a specific problem of this module.
Unfortunately, I don't have time for a proper solution. But here is a quick fix: https://git.drupalcode.org/issue/pwa-3404421/-/commit/adbea176cc0ad51a02...
With this patch, the fallback URLs can be overridden via the settings.php. No icon should be uploaded in the backend for this to work.An acceptable solution for me would be to replace the file upload field in the ManifestConfigurationForm with three path fields, similar to the Theme Settings form for the favicon and logo.