The function minify_js_alter() is called for any page also when minify_js is 0.

Comments

geberele created an issue. See original summary.

geberele’s picture

StatusFileSize
new4.24 KB
geberele’s picture

Status: Needs work » Needs review

Tested with the wrong branch 7.x-1.x instead of 7.x-1.3.

Status: Needs review » Needs work

The last submitted patch, 2: refactor_minify_js_alter-2782051-2.patch, failed testing.

geberele’s picture

Status: Needs work » Needs review
geberele’s picture

StatusFileSize
new4.24 KB

Right the test is failing because of 'ERROR: No valid tests were specified.'
The first patch was already fine.

Status: Needs review » Needs work

The last submitted patch, 6: refactor_minify_js_alter-2782051-6.patch, failed testing.

geberele’s picture

Status: Needs work » Patch (to be ported)
atul.bhosale’s picture

@geberele
Condition "if ($minify_js) {...}" will prevent the capturing of js, which will result in "JavaScript files not found..." at Performance => Minify JavaScript files.

spaghettibolognese’s picture

Version: 7.x-1.3 » 7.x-1.4
Assigned: geberele » Unassigned
Status: Patch (to be ported) » Needs review
StatusFileSize
new2.49 KB

I have updated the patch from #6 to work with the current version of this module.

@Atul Bhorsale: That should not happen. The patch just checks if the setting "Use Minified JavaScript files" on the performance page is enabled. I have tested this on a development environment and it works correctly.

sgdev’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Status: Needs review » Postponed

Marking as postponed. I don't think this patch is needed based on what I see in the current 7.x-1.x-dev version. Looks like it has been changed since this patch was created.

The code skips js_alter if minify_js is 0:

  if (intval(variable_get('minify_js', 0))) {
    /* Replace the JavaScript path by minified path into $scripts without changing the order */
    foreach ($cache as $key => $value) {
      if (isset($scripts[$key]) && $value['status']) {
        $scripts[$key]['data'] = $value['minified_file_path'];
        $scripts = _minify_replace_array_key($scripts, $key, $value['minified_file_path']);
      }
    }
  }

If someone thinks this is still necessary, feel free to post a response.