The selected file /tmp/filetRzQRu could not be uploaded, because the destination sites/default/filesmin.js is not properly ...

rsvelko - June 4, 2009 - 14:13
Project:Javascript Aggregator
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

I think I solved the problem that emmits a warning like : "The selected file /tmp/filetRzQRu could not be uploaded, because the destination sites/default/filesmin.js is not properly configured."

It was because the

preg_match_all($pattern, $scripts, $matches);

on line 86-87 (stable ot CVS version release )

when run on a whitespace $scripts variable returns an empty value in $matches[2][0]...

On my brand new site with javascript_aggregator 1.2

i saw that the function _javascript_aggregator_minify($scripts) {
func was called 2 times - once with the main drupal $scripts and secondly with the $js_footer scripts... The second one for some reason was equal to " " - single space or similar... whitespace for sure.

So now in the module $js_footer is being cheked for being empty - and the preg_match_all does not check if it gets sth or nothing ....

The simple solution attached - an if added to the preg_match....

Code not indented on purpose beneath that "if" I add - for simplicity of the patch and cause if you indent it you must correct the <

AttachmentSize
patch_cope_with_empty_scripts_variables.patch.txt1.02 KB

#1

rsvelko - June 4, 2009 - 14:23

rerolled against CVS version and stripped the dirs in the diff path - now is one .module file only

AttachmentSize
patch_cope_with_empty_scripts_variables.patch.txt 828 bytes

#2

jamestamr - June 16, 2009 - 13:57

Works for me 6.12.

#3

kmonty - July 8, 2009 - 19:51
Status:active» reviewed & tested by the community

Also works for me. +1

#4

BenKewell - July 15, 2009 - 11:02

could a new version be released to include this patch?
though it seems not breaking my website, the error message is pretty annoying

#5

geerlingguy - July 22, 2009 - 18:53

Confirming that this patch works (again). Please roll it into a release at some point :-)

#6

derjochenmeyer - July 22, 2009 - 21:46
Status:reviewed & tested by the community» fixed

committed: http://drupal.org/cvs?commit=241454

New version 6.x-1.3 released.

#7

geerlingguy - July 22, 2009 - 22:01

Nice! Talk about a quick release :-)

#8

derjochenmeyer - July 22, 2009 - 22:08
Status:fixed» closed

;)

 
 

Drupal is a registered trademark of Dries Buytaert.