lmsace / academi

Academi - a responsive moodle theme developed by LMSACE
6 stars 10 forks source link

Duplicate HTTP request for theme.js #25

Open leonstr opened 2 years ago

leonstr commented 2 years ago

When loading the home page with the Academi theme selected there are two HTTP requests:

GET lib/javascript.php/1654850719/theme/academi/javascript/theme.js GET theme/javascript.php/academi/1654850739/footer

The content being downloaded for each is identical, a minified version of theme/academi/javascript/theme.js.

Moodle 4.0.1+ (Build: 20220603), academi 2022051700.

leonstr commented 2 years ago

The request for .../theme/academi/javascript/theme.js is triggered by theme/academi/lib.php:theme_academi_page_init() line 32:

    $page->requires->js('/theme/academi/javascript/theme.js');

The request for .../footer is triggered by theme/academi/config.php line 47:

$THEME->javascripts_footer = ['theme'];

Removing this line from theme/academi/config.php stops the duplicate request from occurring and the theme still appears to work as expected.

leonstr commented 2 years ago

This change is available in commit 5999035 of my fork.

prasanna-lmsace commented 2 years ago

Hi leonstr,

Thanks for notifying the issues.

We will update the fix in the next release.