If a user doesn't have the access pwa permission then when pwa/serviceworker/js is accessed pwa.pages.inc will not be loaded by menu_execute_active_handler(), which means pwa_deliver_js_file() isn't accessible, and therefore drupal_deliver_page() kicks out a watchdog error:
delivery callback not found: callback pwa_deliver_js_file not found: pwa/serviceworker/js.
I'm also seeing javascript errors:
The script has an unsupported MIME type ('text/html').
Failed to load resource: net::ERR_INSECURE_RESPONSE
Possible solutions:
- Load
pwa.pages.inc ourselves (hook_init?)
- Move
pwa_deliver_js_file() into pwa.module
I think 2 would be a cleaner solution.
Comments
Comment #2
mustanggb commentedComment #3
joekrukoskyI used option #2 as a patch and it worked perfectly. Will upload patch file shortly...
Comment #4
joekrukoskyPatch based on option #2.
Comment #5
rudolfbykerPatch in #4 is malformed. Try this one.
Comment #7
nod_Fixed in the 7.x-2.x branch, thx
Comment #8
mustanggb commentedThanks