Now that libraries 2 is in full and recommended release (with 3x already underway), and part of standard/typical installs,

drush rl libraries
------- RELEASES FOR 'LIBRARIES' PROJECT -------
 Release         Date         Status                            
 7.x-3.x-dev     2012-Jul-30  Supported, Development            
 7.x-2.x-dev     2012-Jul-29  Development                       
 7.x-2.0         2012-Jul-29  Supported, Recommended, Installed 
 7.x-1.x-dev     2011-Feb-25  Development                       
 7.x-1.0         2011-Jan-27  Supported                         

Can we get any new info on roadmap for filedepot's support of Libraries 2? Atm, of course, it's still reporting:

drush pm-enable filedepot
 Module filedepot cannot be enabled because it depends on libraries  (1.x) but 2.0 is available            [error]
CommentFileSizeAuthor
#3 filedepot_librariesv2.patch5.75 KB_timpatrick

Comments

markus_petrux’s picture

Hi, I think this is caused by #1734828: Explicitly declare libraries 1.x dependency, that added explicit requirement of v1 of libraries module, while it could have been a better approach, with future in mind, to review the way external libraries are managed here, and adapt installation instructions and/or use of libraries API. Cheers

Please note there may be other module in the site that require latest versions of Libraries API. Keeping v1 and v2 of the same module is not possible I'm afraid.

drupsup’s picture

Hi,

I'm not asking what it's caused by -- that's fairly clear: It's not compatible with libraries v2x.

In a number of posts, including, e.g.:

https://drupal.org/node/1589586

The reasoning repeatedly given for non-compatibility has been that v2x is "still in alpha" ...

As that's now clearly changed, my question is, simply, what are the plans for v2x support, if any exist ?

Libraries v2x is no longer an option for many.

Since concurrent version install of v1x & v2x is a no-go, that renders Filedepot non-functional for now.

_timpatrick’s picture

Assigned: Unassigned » _timpatrick
Status: Active » Fixed
StatusFileSize
new5.75 KB

Version 2 of the libraries is now supported.
I committed the changes and attached is a patch based off the latest dev release.

To use:
Assuming your libraries folder is located at sites/all/libraries, create the following directories:
- sites/all/libraries/html_encoder
- sites/all/libraries/jquery.blockui

The following javascript files then need to be retrieved and saved to their respective folders under the sites/all/libraries folder.

> http://www.strictly-software.com/scripts/downloads/encoder.js - SAVE FILE as: sites/all/libraries/html_encoder/html_encoder.js
> http://malsup.github.com/jquery.blockUI.js - SAVE FILE as sites/all/libraries/jquery.blockui/jquery.blockui.js

Hope this fixes the issues you were encountering.
Thank you

drupsup’s picture

Status: Fixed » Active

Not quite. Something's still awry.

The following javascript files then need to be retrieved and saved to their respective folders under the sites/all/libraries folder.

> http://www.strictly-software.com/scripts/downloads/encoder.js - SAVE FILE as: sites/all/libraries/html_encoder/html_encoder.js
> http://malsup.github.com/jquery.blockUI.js - SAVE FILE as sites/all/libraries/jquery.blockui/jquery.blockui.js

cd sites/all/libraries
ls -al jquery.blockui/ yui_2.7.0/ html_encoder/
	html_encoder/:
		-rw-rw----+  1 wwwrun www  12K Nov 10  2011 encoder.js
		lrwxrwxrwx   1 wwwrun www   10 Aug 26 20:14 html_encoder.js -> encoder.js

	jquery.blockui/:
		lrwxrwxrwx   1 wwwrun www   17 Aug 27 15:24 jquery.blockui.js -> jquery.blockUI.js
		-rw-rw----+  1 wwwrun www  18K Aug 26 20:14 jquery.blockUI.js

	yui_2.7.0/:
		drwxrwx---+  4 wwwrun www 4.0K Feb 19  2009 as-docs/
		drwxrwx---+  2 wwwrun www 4.0K Feb 19  2009 assets/
		drwxrwx---+ 50 wwwrun www 4.0K Feb 19  2009 build/
		drwxrwx---+  3 wwwrun www  20K Feb 19  2009 docs/
		drwxrwx---+ 43 wwwrun www 4.0K Feb 19  2009 examples/
		-rw-rw----+  1 wwwrun www  18K Feb 19  2009 index.html
		-rw-rw----+  1 wwwrun www  357 Oct 27  2010 README
		drwxrwx---+  2 wwwrun www 4.0K Feb 19  2009 releasenotes/
		drwxrwx---+ 29 wwwrun www 4.0K Feb 19  2009 tests/

A fresh pull of filedepot -dev, patch applied,

	drush pm-list | egrep "filedepot|libraries|\(system\)"
		 Core                       System (system)                                  Module  Enabled        7.15
		 File management            Filedepot (filedepot)                            Module  Enabled        7.x-1.0-beta2+15
		 Other                      Libraries (libraries)                            Module  Enabled        7.x-2.0

clear all caches, visit

https://testl.loc/filedepot

I get a blank/empty Filedepot UI.

In JS console I still see,

	ReferenceError: jQuery is not defined
	https://testl.loc/filedepot
	Line 165
_timpatrick’s picture

Hmm that error you are getting is not related to a missing library.
Check out:
http://stackoverflow.com/questions/4681309/using-jquery-in-drupal-7

The error you would get for a missing library would be jQuery.blockUI is not defined.

Tim

drupsup’s picture

Minor edit, what's above is what get's cp'd-n-pasted via Firebug's "Copy Error":

ReferenceError: jQuery is not defined
https://testl.loc/filedepot
Line 165

What I actually *see* in the Firebug Console is:

ReferenceError: jQuery is not defined
jQuery.blockUI();

And jQuery is most certainly installed; it's in wide use across my site.

_timpatrick’s picture

That error is pointing to the fact that jQuery itself has not been defined, not the blockUI module.
The error that would point to the library file not being included is:

TypeError: jQuery.blockUI is not a function
jQuery.blockUI();

You can check to see if the library is being included by simply looking at the sources window in firebug - I think this issue is related to the link I sent, something to do with $ being overwritten.

Also:
What is the output of libraries_get_libraries() ?

Do the files that exist at https://testl.loc/sites/all/libraries/html_encoder/html_encoder.js and https://testl.loc/sites/all/libraries/block.ui/block.ui.js contain the proper JS code?

Can you try un-enabling Filedepot in the module administration area and then re-enabling to flush the hook cache?

drupsup’s picture

You can check to see if the library is being included by simply looking at the sources window in firebug

Viewsource @ https://test.loc/Filedepot

	<!DOCTYPE html>
	<html lang="en" dir="ltr" >

	<head>

	...

	<script src="https://test.loc/sites/all/modules/contrib/labjs/labjs.min.js?m9fy6l"></script>
	<script>
	// LABjs exclusion
	var $L = $LAB.setGlobalDefaults({AlwaysPreserveOrder:true});
	</script>
	<script>
	// LABjs exclusion
	$L = $L.script(["https://test.loc/sites/default/files/js/js_LP6eaYL3pE-X3CISx4yhE59L-xvxjYoQEJLVKAKrEjo.js",
	"https://test.loc/sites/default/files/js/js_099bsOo-KSbuDt4tXwe_jK9npd-2f3JRMawX4NZkniw.js",
	"https://test.loc/sites/default/files/js/js_s_aVcDvGxh84zMB6LeoZoJiNtH51y6jgaOolTNSaVwc.js",
	"https://test.loc/sites/default/files/js/js_lvkGZQ8mbsx9uCcetuej2u5We0m11UQoUoX1-6MvYDQ.js",
	"https://test.loc/sites/default/files/js/js_SqSPKHRdgR49lUgM5xyDHyrUmB1wUEtOwPIRN_Hqmew.js"]);
	</script>
	<script>
	$L = $L.wait(function() {
	jQuery.extend(Drupal.settings, {"basePath":"\/","pathPrefix":"","ajaxPageState":{...,"js":{"sites\/all\/modules\/contrib\/labjs\/labjs.min.js":1,"sites\/all\/modules\/contrib\/jquery_update\/replace\/jquery\/1.7\/jquery.min.js":1,...  

	...

	<script>
	// LABjs exclusion
	$L = $L.wait(function() {Drupal.scriptsready=true;jQuery(document).trigger('scripts-ready');});
	</script>

	...
	</body>
	</html>
What is the output of libraries_get_libraries() ?

libraries_get_libraries() -->

	array(9) {
	  ["yui_2.7.0"]=>       string(29) "sites/all/libraries/yui_2.7.0"
	  ["oauth"]=>           string(25) "sites/all/libraries/oauth"
	  ["yui"]=>             string(23) "sites/all/libraries/yui"
	  ["modernizr"]=>       string(29) "sites/all/libraries/modernizr"
	  ["blockui"]=>         string(27) "sites/all/libraries/blockui"
	  ["html_encoder"]=>    string(32) "sites/all/libraries/html_encoder"
	  ["jquery.blockui"]=>  string(34) "sites/all/libraries/jquery.blockui"
	  ["phpsass"]=>         string(27) "sites/all/libraries/phpsass"
	  ["ckeditor"]=>        string(28) "sites/all/libraries/ckeditor"
	}
Do the files that exist at https://testl.loc/sites/all/libraries/html_encoder/html_encoder.js and https://testl.loc/sites/all/libraries/block.ui/block.ui.js contain the proper JS code?

Not sure what's "proper". Here's what I have:

cat https://testl.loc/sites/all/libraries/html_encoder/html_encoder.js
cat https://testl.loc/sites/all/libraries/block.ui/block.ui.js

Can you try un-enabling Filedepot in the module administration area and then re-enabling to flush the hook cache?

Did that. Also a `drush cc all`. As well as a complete uninstall/reininstall. The issue -- the blank UI -- is consistently reproducible.

_timpatrick’s picture

Thanks!

It seems from what you have posted the libraries have been included - and have the proper code in them (I am assuming the "cat x" at the top of the pastebin files was put there for readability and is not in the original file).

Since the error is "jQuery is not defined", it makes me think its still related to http://stackoverflow.com/questions/4681309/using-jquery-in-drupal-7

The easiest way to make sure its not Filedepot's fault / the blockUI libraries fault is to simply pull head b6336f7 (the revision before the v2 update) and try that. You should get the same error. If not, I wonder if the jQuery.blockUI library needs to be wrapped - maybe its interfering with another JS library another module you have installed is using.

Did you add any custom JS to your site that is referencing the $ variable?

Taking the fix from the stackoverflow website, perhaps putting the following code around the jQuery blockui function in jquery.blockui.js would work:

At the top of the jquery function ";(function() {", add this line:
;(function ($) {

So it looks like this now:

;(function ($) {
;(function() {

	function setup($) { ..........

And at the bottom add this line:
})(jQuery);

So the bottom looks like this now:

........

	if (typeof define === 'function' && define.amd && define.amd.jQuery) {
		define(['jquery'], setup);
	} else {
		setup(jQuery);
	}

})();
})(jQuery);

That is the fix for the jQuery is not defined error in Drupal if the block ui library is causing it - let me know if it works.

drupsup’s picture

I am assuming the "cat x" at the top of the pastebin files was put there for readability and is not in the original file

That's correct.

pull head b6336f7 (the revision before the v2 update) and try that. You should get the same error. If not, I wonder if the jQuery.blockUI library needs to be wrapped - maybe its interfering with another JS library another module you have installed is using.

Ref: http://drupalcode.org/project/filedepot.git/commit/96de80a

git clone --recursive --branch master http://git.drupal.org/project/filedepot.git
cd filedepot
git reset --hard b6336f735ae6e3a959c30d73420c3f87ec044d61
	HEAD is now at b6336f7 Libraries dependency for v 1.x added

Returns same error

ReferenceError: jQuery is not defined
jQuery.blockUI();
Filedepot (line 165)

Did you add any custom JS to your site that is referencing the $ variable?

Yes,

(function($) {
 Drupal.behaviors.js001 = {
  attach: function(context,settings) {
	$('#floater').click(function () {
		.dialog({ title: "site info",autoopen: false,height: 300,width: 650,modal: true, })
		.dialogExtend({ "maximize" : true, "dblclick" : "maximize", })
	});
}};})(jQuery);

(function($) {
 Drupal.behaviors.js002 = {
  attach: function(context,settings) {
	$("div#zone-content.zone div#region-content").css("display", "none");
	$("div#zone-content.zone div#region-content").fadeIn(500);
}};})(jQuery);
Taking the fix from the stackoverflow website, perhaps putting the following code around the jQuery blockui function in jquery.blockui.js would work:
...
That is the fix for the jQuery is not defined error in Drupal if the block ui library is causing it - let me know if it works.

applying

diff -ur ./libraries/jquery.blockui/jquery.blockui.js.ORIG  ./libraries/jquery.blockui/jquery.blockui.js
--- ./libraries/jquery.blockui/jquery.blockui.js.ORIG 2012-08-28 07:37:40.179239440 -0700
+++ ./libraries/jquery.blockui/jquery.blockui.js      2012-08-28 07:38:09.077133394 -0700
@@ -12,6 +12,7 @@
  * Thanks to Amir-Hossein Sobhi for some excellent contributions!
  */

+;(function ($) {
 ;(function() {

        function setup($) {
@@ -527,3 +528,4 @@
        }

 })();
+})(jQuery);

Filedepot UI is still blank.

JS console Error still displays:

ReferenceError: jQuery is not defined
jQuery.blockUI();
Filedepot (line165)
drupsup’s picture

Title: status update on filedepot for libraries2 release version? » blank Filedepot UI with libraries v2
Category: support » bug

title & category change

_timpatrick’s picture

The error isn't from Filedepot - it just shows up because Filedepot uses jQuery to load, and if the jQuery object is missing then it won't load, hence the white screen and error "jQuery is not defined".

I believe it is the custom JS code - that is what the stackoverflow article I linked to seems to think too.
You could always test that by removing the custom JS code and seeing if the jQuery object is back.

Are you sure that is the only custom JS code you have? Everything has to be wrapped in the "function ($) {" etc wrappers if you are referencing the $ variable as per the stackoverflow article.

drupsup’s picture

Are you sure that is the only custom JS code you have?

Yes. I add those two, and only those two, JS stanzas.

Removing them has no effect -- the Filedepot UI is still blank, and the console error is the same.

Just for reference, none of my other installed module's output has any issues -- JS-related or otherwise.

drupsup’s picture

Title: blank Filedepot UI with libraries v2: filedepot's YUI-loader conflicts with existing, site-wide loader (labjs) » blank Filedepot UI with libraries v2
Install a new, 'vanilla' Drupal 7.15 instance with NO custom/DIY js code.

drush @vanilla en -y  seven bartik
drush @vanilla vset theme_default bartik
drush @vanilla vset admin_theme   seven
drush @vanilla vset clean_url 1 --yes

drush @vanilla dl \
 jquery_update-7.x-2.x-dev
 ctools \
 libraries-7.x-2.0 \
 filedepot-7.x-1.x-dev \
 labjs \

drush @vanilla en ctools jquery_update libraries

@ admin/config/development/jquery_update,
set jquery Version -> 1.7

install the filedepot library prereqs ...

drush @vanilla en filedepot

@ nav to:

	http://vanilla.loc/Filedepot

in browser,

	Strict warning: Only variables should be passed by reference in include() (line 315 of /srv/www/vanilla/sites/all/modules/filedepot/theme/filedepot-mainpage.tpl.php).

Here's the ViewSource -> http://pastebin.com/D4A4FE60

*NO* errors in JS console, and

the Filedepot UI is *VISIBLE*.




NEXT,

drush @vanilla en labjs
drush @vanilla cc all

@ nav to:

	http://vanilla.loc/Filedepot

in browser,

	Strict warning: Only variables should be passed by reference in include() (line 315 of /srv/www/vanilla/sites/all/modules/filedepot/theme/filedepot-mainpage.tpl.php).

Here's the ViewSource -> http://pastebin.com/QyCrVjjF

in error console,

	TypeError: jQuery.blockUI is not a function
	jQuery.blockUI();
	Filedepot (line 190)

the Filedepot UI is *BLANK*.




@ my FULL site

/admin/config/development/labjs
	--> Enable on every page except the listed pages.
		--> 'filedepot'

nav to:

	.../Filedepot

the Filedepot UI is *VISIBLE*.

Here's what I see:

	--> http://imageshack.us/photo/my-images/96/filedepot.png/


EDIT:
@ a quick test, I can add a folder in Filedepot UI, but changes in UI listing do NOT refresh on add -- I have to manually refresh the page ...

My *suspicion* is that that may be a YUI-js caching issue, as fildepot's adding YUI source as inline:

  $yuiloader = array(
    '#type' => 'markup',
    '#markup' => '<script type="text/javascript" src="' . $yui_base_url . 'yuiloader/yuiloader.js"></script>',
  );
  drupal_add_html_head($yuiloader, 'yuiloader_script');

rather than using drupal_add_js() code to add the external source.  Not clear to me why that's being done.

drupsup’s picture

Title: blank Filedepot UI with libraries v2 » blank Filedepot UI with libraries v2: filedepot's YUI-loader conflicts with existing, site-wide loader (labjs)

title update

drupsup’s picture

Title: blank Filedepot UI with libraries v2 » blank Filedepot UI with libraries v2: filedepot's YUI-loader conflicts with existing, site-wide loader (labjs)

Fyi, @ https://drupal.org/project/labjs, there are apparently methods to disable labjs for all/some script:

"Module developers can indicate which code should not be labjsified."
"To disable LABjs in certain pages, call labjs_suppress(TRUE) in those page. Useful for admin pages for example."

although, it's not apparent that either of those address the loading/use of an additional JS-loader ...

Note:
https://drupal.org/project/labjs
"LABjs won't have a D8 release. ... The LABjs library has stopped its future development in favor on AMD loaders."

and that there's discussion underway for selection/integration of a JS_loader into Drupal core:

"Script loader support in core (LABjs etc.)"
https://drupal.org/node/1033392

"Use AMD for JS architecture"
https://drupal.org/node/1542344

In any case, the Filedepot's loader-usage should not conflict with the use of a site-wide JS-loader.

stboch’s picture

Incase anyone is getting this issue. I found out that it related to the Case Sensitivity of unix. The site downloaded the file as jquery.blockUI.js and it needs to be jquery.blockui.js. Hopes this helps some!

_timpatrick’s picture

Status: Active » Closed (cannot reproduce)

Yup case sensitivity is important - in the original issue however the file was named properly.

mfuggle’s picture

I have been trying to get Filedepot working for three days now and have given up. I am getting the error that is being reported elsewhere (Object function has no method 'blockUI') but I can find no solution to this.

It's a pity since it seems to be what I want but without a solution from the developers on a very specific error it's of no value.

Cheers
Martin Fuggle

blainelang’s picture

Martin, in all cases, the issue is not something the developer can solve in code. If someone does not create the external libraries with the correct name or places them in the correct location - this is not a module code issue.

Are you using the libraries module 1.x or 2.x?
What version of filedepot are you using (the dev release or beta2)?
Eliminate other possible conflicts (modules, theme or other custom javascript)

webking_amsterdam’s picture

Could anyone tell me where to download the YUI library 2.7.0 or whether the version yui 2.9.0 can be used to serve that library on the server for the Filedepot module ?

From the site: https://github.com/yui/yui2 and http://yuilibrary.com/projects/yui2/ I could only download the version Yui_2.9.0 zip

I did not succeed in finding it elsewhere from a reliable source ....

meecect’s picture

Issue summary: View changes

I had a similar problem and tracked it down to my combination of jquery_update and jquery.blockui. Changing jquery versions to 1.7 fixed it for me.

suncorjohn’s picture

Updated to latest version of jquery, still no luck in Drupal 7 site. Just hangs on Please wait.. dialog