The CACHE_OFFLINE_IMAGE expect that the module is installed under the "modules/contrib" directory which is not always true as if the user use the install new module form in Drupal UI, the pwa module is put in "modules/" directory only thus making the request to the offline image returns 404

saving the module path in drupalSettings and retrieving it may solve this issue.

$build['#attached']['drupalSettings']['mymodule']['mylib']['path'] = drupal_get_path('module', 'mymodule');

Comments

danreb created an issue. See original summary.

alexborsody’s picture

StatusFileSize
new1.21 KB

Meant to change that, here's the patch.

  • AlexBorsody committed bb032e0 on 8.x-1.x
    Issue #3072113 by AlexBorsody, danreb: 404 error for CACHE_OFFLINE_IMAGE...
alexborsody’s picture

Assigned: Unassigned » alexborsody

If this checks out I'm going to push it to the next release hopefully today.

danreb’s picture

Status: Active » Reviewed & tested by the community

Tested ... all good and working

alexborsody’s picture

Status: Reviewed & tested by the community » Fixed
alexborsody’s picture

Status: Fixed » Closed (fixed)
alexborsody’s picture