I just upgraded from 7.x-1.1 to 7.x-1.x-dev and I could swear the Slickgrid module use to work, but now it doesn't. Also no error is being thrown.

http://drupal.org/project/slickgrid

Broken screenshot http://awesomescreenshot.com/0edhv2tf9

Comments

jcisio’s picture

Frankly I don't know why it breaks. From 1.1 to 1.x-dev I only move from the LABjs version 1.1 to 2.0 with a better queueing system and some optimization.

I was going to test slickgrid, but I looked at the dependency and I told myself: "next time".

So I recommend you to go back to the 1.1 (there is no db change). Or better, test the 1.1 with the labjs.js shipped with the latest 1.x-dev to see if it is labjs.js problem.

bryancasler’s picture

Thanks jcisio, I'm out of town for the weekend. When I get back home I'll give your suggestions a try.

bryancasler’s picture

Just tested the 1.1 version and it didn't work, guess I was mis-remembering.

I tried to exclude all of Slickgrids JS, but I don't think I'm doing it right.

<?php if (module_exists('labjs')): ?>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
	$L = $L.script(["http://website.com/sites/all/libraries/slickgrid/lib/firebugx.js"]);
	$L = $L.script(["http://website.com/sites/all/libraries/slickgrid/lib/jquery.event.drag-2.0.min.js"]);
	$L = $L.script(["http://website.com/sites/all/libraries/slickgrid/slick.core.js"]);
	$L = $L.script(["http://website.com/sites/all/libraries/slickgrid/slick.dataview.js"]);
	$L = $L.script(["http://website.com/sites/all/libraries/slickgrid/slick.grid.js"]);
	$L = $L.script(["http://website.com/sites/all/libraries/slickgrid/plugins/slick.checkboxselectcolumn.js"]);
	$L = $L.script(["http://website.com/sites/all/libraries/slickgrid/plugins/slick.rowselectionmodel.js"]);
	$L = $L.script(["http://website.com/sites/all/libraries/slickgrid/controls/slick.columnpicker.js"]);
	$L = $L.script(["http://website.com/sites/all/modules/slickgrid/plugins/filters/slickgrid.filters.js"]);
	$L = $L.script(["http://website.com/sites/all/modules/slickgrid/js/slickgrid.js"]);
	$L = $L.script(["http://website.com/sites/all/modules/slickgrid/js/slickgrid.theme.js"]);
	$L = $L.script(["http://website.com/sites/all/libraries/slickgrid/controls/slick.pager.js"]);
	$L = $L.script(["http://website.com/sites/all/modules/slickgrid/js/controls/slickgrid.clone.js"]);
//--><!]]>
</script>
<?php endif ?>
bryancasler’s picture

Alternatively, is there a way I can prevent labjs from running on certain pages? This is only effecting two pages on the whole site, so I don't mind using a workaround for the time being.

jcisio’s picture

Add a feature request to disable labjs in certain pages. But currently you can do it, by checking the path in a hook_init() then run defined('LABJS_DISABLE', TRUE);

bryancasler’s picture

jcisio’s picture

Thanks for the issue. There was also an error in the code above. It should be define('LABJS_DISABLE', TRUE); (without "d").

bryancasler’s picture

jcisio, I'm trying to check the path with hook_init, but I can't get it working. Can you point me in the right direction?

function hook_init() {
	if (current_path() == "/resources") {defined('LABJS_DISABLE', TRUE);}
}
jcisio’s picture

It should be "define" not "defined".

bryancasler’s picture

This is what I've got so far, but it's not working

labjs_disabler.info

name = LABjs Disabler
description = Disables LABjs on certain pages.
core = 7.x
package = Javascript Utilities

labjs_disabler.module

<?php

/**
 * Disable LabJS on certain pages
 */
function labjs_disabler_hook_init() {    
  if (current_path() == "/private/members/search") {
    define('LABJS_DISABLE', TRUE);
  }
}
jcisio’s picture

If your module is labjs_disabler, your function should be labjs_disabler_init(). I'm not sure if you define current_path() elsewhere, too, but I think you can check it.

http://api.drupal.org/api/drupal/includes--module.inc/group/hooks/7

Last weekend I was busy with the Taskbar module, hope I'll have some free time implementing the url black list feature this week.

bryancasler’s picture

Thanks for all the positive feedback jcisio. I've been working with you and some helpers over at stackoverflow
http://drupal.stackexchange.com/questions/9074/how-should-i-use-hook-init

I took your suggestions as well as another on stack over flow to use drupal_get_path_alias() instead, but still no dice. Since you plan on fixing this, I'd probably be wasting more of your time asking you for help than it would take to make the actual fix. So I'll shut up :) I appreciate your help and I look forward to the changes.

jcisio’s picture

Status: Active » Fixed
jcisio’s picture

Category: bug » feature

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.