Thanks so much for this great module! It's a huge help out of the box.
I've got it successfully running on a live D7 project and trying to do the same on a D8 project that I'm currently developing.
Since the D8 version is different in some ways, I hope, you can help me to solve some image-related mysteries. :-)
When I upload an image on /admin/config/pwa/settings
, I see this error in the browser console:
Error while trying to use the following icon from the Manifest: http://localhost/sites/default/files/pwa/android-chrome-512x512.pngcopy2.png (Download error or resource isn't a valid image)
Here are a couple situations:
#1: The module has appended copy2.png
to the original file name. It appears to be the same issue as mentioned in
comment #31 of Fully working D8 version based on D7 Serviceworker →
. But #2 is the actual problem that breaks stuff.
#2: The full URL should be http://localhost/mysite/web/sites/default/files/pwa/android-chrome-512x512.pngcopy2.png
So, mysite/web/
is missing. The generated preview of the uploaded image on this config page is missing as well, due to the broken URL. The preview image URL in the HTML source code looks like that: <img src="/sites/default/files/pwa/android-chrome-512x512.png" width="200">
.
I haven't looked at the module code but since the image URL is starting with /sites
, my guess is that some sort of $base_url
is missing there.
#3: The image upload field on config page /admin/config/pwa/settings
expects 512x512px images.
On PWA Extra's config page /admin/config/pwa/pwa_extras
it provides this uploaded image in 192x192px, though:
192x192" href="/sites/default/files/pwa/android-chrome-512x512.pngcopy.png">.
Would it make sense to either adopt the 512x512 to 192x192px or to provide a separate image upload for this 192x192px touch icon?
Is there a hook function, like in D7, for those images that I could use instead?
I'm on Drupal 8.7.9, with PHP 7.3 on the latest MAMP 5.5.
Please, let me know if I can provide more specific info to help solve the issues.
Thanks again for your valuable work! :-)