On a fresh drupal install, everything appears to install ok and I can create homeboxes, but I can not drag/drop or add new content. It's as if none of the javascript works.

Comments

brianV’s picture

Thanks for posting this in it's own issue. I cannot reproduce in my test environments here, but hopefully we can collect confirming reports from others here.

Seraphin42’s picture

Hi,

I confirm the problem of g5605. I installed Homebox, and I created a "dashboard".
I added some blocks and when I go to my dashboard, I can't use javascript.

Here the debug from Chrome console :

Uncaught TypeError: Cannot call method 'match' of undefined
Line 87 Homebox.js :
if ($(this).parent('.homebox-column-wrapper').attr('style').match(/width: 100%/i)) {

I have no problems of javascript on the Test Homebox generated by the module except these notices :

Notice: Undefined index: navigation in homebox_build() (line 350 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).
Notice: Undefined index: navigation in menu_block_view() (line 456 of /data/www/mastermindv2/modules/menu/menu.module).
Notice: Undefined index: navigation in homebox_prepare_block() (line 626 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).
Notice: Undefined index: info in homebox_build() (line 396 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).

Hope it can help you.
Thank you a lot for your work on this great module ;-)

brianV’s picture

What browsers are you using?

$(this).parent('.homebox-column-wrapper').attr('style') should be a string corresponding to the value of 'style' attribute on the selected element. match() checks to see if the following regex is within that string, and works properly on Firefox 3.6.13.

Documentation for match() is here: http://www.w3schools.com/jsref/jsref_match.asp

This may be a browser-specific bug. It would have been introduced with this issue: http://drupal.org/node/1037968

I may just have to revert the above issue temporarily until we find a better way to match the width statement than 'match()'.

Thoughts?

g5604’s picture

I am using chrome, but I checked in firefox and the problem persists.

brianV’s picture

Can you tell me the versions of each?

Seraphin42’s picture

Tested with firefox 3.6.13 (Mac OS X) : Erreur : $(this).parent(".homebox-column-wrapper").attr("style") is undefined
Fichier Source : https://xxx.xxx.com/sites/all/modules/homebox/homebox.js?lgnexa Ligne : 87

Tested with Chrome 9.0.597.102 (Mac OS X) : Uncaught TypeError: Cannot call method 'match' of undefined Line 87 Homebox.js :
if ($(this).parent('.homebox-column-wrapper').attr('style').match(/width: 100%/i)) {

But I haven't problems with the Homebox example module.

brianV’s picture

StatusFileSize
new1.46 KB

Can you test the below patch, and tell me if that resolves the issue?

Seraphin42’s picture

Sorry, it doesn't work on both Chrome and Firefox ...

var style = $(this).parent('.homebox-column-wrapper').attr('style');
if (style != '' && style.match(/width: 100%/i ) !== null) {
Uncaught TypeError : Cannot call method 'match' of undefined
$(this).height('auto');
maxHeight = Math.max($(this).height(), maxHeight);
}

brianV’s picture

Ok, I think I know what is happening.

Please go to the 'settings' page for your homebox, and enter custom column widths for your columns. When that is done, does dragging start to work in your homebox?

Edit: Please remove the above patch before testing what I wrote in this post.

Seraphin42’s picture

Yeah, it works.

I've got these errors in my custom block :
Notice: Undefined property: stdClass::$module in homebox_block_edit_form_builder() (line 681 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).
Notice: Undefined property: stdClass::$key in homebox_block_edit_form_builder() (line 686 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).
Notice: Undefined property: stdClass::$key in homebox_block_edit_form_builder() (line 689 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).
Notice: Undefined property: stdClass::$key in homebox_block_edit_form_builder() (line 691 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).

g5604’s picture

entering custom column widths for all columns, fixes everything for me :)

brianV’s picture

StatusFileSize
new1.07 KB

@Seraphin42: That is an unrelated issue. Please post in a separate issue.

@Seraphin42, g5605: Attached is a patch that should fix this issue. I would appreciate it if you can test it; if it works for you, I will commit it. It should allow drag and drop to work even if custom widths are not specified.

Seraphin42’s picture

@brianV : it works for javascript, i can drag boxes and use javascript.
BUT, my first column actually does 100% of the screen, and the two other boxes are below the first box.

Here are errors displayed after the patch :
Notice: Use of undefined constant PHP_ROUND_HALF_DOWN - assumed 'PHP_ROUND_HALF_DOWN' in homebox_build() (line 414 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).
Warning: Wrong parameter count for round() in homebox_build() (line 414 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).
Notice: Use of undefined constant PHP_ROUND_HALF_DOWN - assumed 'PHP_ROUND_HALF_DOWN' in homebox_build() (line 414 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).
Warning: Wrong parameter count for round() in homebox_build() (line 414 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).
Notice: Use of undefined constant PHP_ROUND_HALF_DOWN - assumed 'PHP_ROUND_HALF_DOWN' in homebox_build() (line 414 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).
Warning: Wrong parameter count for round() in homebox_build() (line 414 of /data/www/mastermindv2/sites/all/modules/homebox/homebox.module).

brianV’s picture

Status: Active » Fixed

d.org has been down, so I haven't had a chance to post this, but I pushed the above patch since I am very sure it fixes this problem:

http://drupal.org/cvs?commit=500606

Please re-open if you experience this again.

brianV’s picture

Oops - that Constant isn't available until PHP 5.3.0. I've pushed another commit that uses a workaround to accomplish the same functionality, but is compatible with PHP 5.2.X.

http://drupal.org/cvs?commit=500642

*now* this should be fixed.

rod35’s picture

ok with your patch on Chrome
Thanks a lot

g5604’s picture

thanks working well now.

Seraphin42’s picture

It works for me too. Thanks !

Status: Fixed » Closed (fixed)

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

Michsk’s picture

Can this be ported to 6.x-2.x dev ? Experiencing exactly this issue.

Michsk’s picture

1062360-homebox-js-not-working-rev2.patch
Also works for / fixes 6.x-2.x dev.

Michsk’s picture

Drag and drop works but we still log Wrong parameter count for round()

klaashobo’s picture

Hi there,
I really don't understand. I have installed homebox on a clean installation of Drupal 6.2x and cannot move any part of the panels. In all the panels there are four buttons, but they all seem not to work. I have filled all columnwith with a custom % and still do not get working buttons or am able to move the panels. Is there something that I can forget of that I misconfigured?
Hope you will try to help me out here,

mxmilkiib’s picture

Version: 7.x-2.0-beta1 » 6.x-3.x-dev
Status: Closed (fixed) » Needs work

Applying the additional code in the patch to the either 6.x-3.0-beta or 6.x-3.x-dev fixes the problem but, as Iasac notes, there is an error message displayed (on a three column page);

warning: Wrong parameter count for round() in /var/aegir/platforms/bfs01/sites/bfs01.local/modules/homebox/homebox.module on line 390.
warning: Wrong parameter count for round() in /var/aegir/platforms/bfs01/sites/bfs01.local/modules/homebox/homebox.module on line 390.
warning: Wrong parameter count for round() in /var/aegir/platforms/bfs01/sites/bfs01.local/modules/homebox/homebox.module on line 390.

Reopening under 6.x-3.x-dev so this can be looked at, ta. Going back to custom column widths for now.

@klaashobo; If you have tried giving custom column widths then this issue might not be the cause of your problem. What versions of jQuery and jQuery UI do you have installed?

HJulien’s picture

Priority: Normal » Major

I am not able to move any blocks into my homeboxes. I can move them into the columns, but when I save, then move back to the disabled section. It doesn't matter which column, which block or which homebox page. I set the columns width and that didn't make a difference. I've checked every single permission and everything matches with those blocks already in the homeboxes. Even the most basic Drupal-provided blocks can't be added.

This patch above - will it solve this issue? I am using the current recommended release - is there a solution to this included in the dev version?

I love this module and I really want to be able to continue using it but it's stuck and I can't move forward in my work with it like this.

Any help would be appreciated. Thank you!

HJulien’s picture

I'm still stuck. I'm thinking I might try removing all of the blocks currently in the homeboxes but that might not make any difference at all given I can't save any blocks. Does Flush remove all of the blocks? Does it clear anything else? I can't find any documentation on this feature.

The only other thing I can think of is to uninstall the module and start with a fresh copy but I'm concerned about all of the rebuilding I'd need to do since the homeboxes are the central connectors of the website. This would be my last resort....

What does Flush do?

HJulien’s picture

Update on previous 2 comments:

Flushing the settings did nothing. I couldn't even remove blocks from the homebox pages. I uninstalled homebox completely and then installed a fresh copy of 6.x-3.0-beta2. I can create a new page but can't add anything to it - not even to the test page.

I'm looking for ideas on what to do now. Is the development version a better option to try? Is there another module I can use that provides functionality?

So far I haven't gotten any feedback on this and I'm really disappointed.

HJulien’s picture

I've tried disabling most of my modules but still it's not working. Is it possible that this module is out of sync with the available jquery_ui module? I had 6.x-1.4 and just updated to 6.x-1.5 to see if that made a difference. None. How about the jquery download itself? I have 6 so I didn't update that.

There are discrepancies between what is available and what your documentation says is required. I never had 6.x-1.3 since it wasn't available at the time but 6.x-1.4 worked at the beginning.

I'm just bashing my head here and will give up soon.

drufiz’s picture

Hi,

how do I install the patch 1062360-homebox-js-not-working.patch ?

drufiz’s picture

Notice: Undefined property: stdClass::$module in homebox_block_edit_form_builder() (Zeile 688 von /var/www/web537/html/kle/sites/all/modules/homebox/homebox.module).
Notice: Undefined property: stdClass::$key in homebox_block_edit_form_builder() (Zeile 693 von /var/www/web537/html/kle/sites/all/modules/homebox/homebox.module).
Notice: Undefined property: stdClass::$key in homebox_block_edit_form_builder() (Zeile 696 von /var/www/web537/html/kle/sites/all/modules/homebox/homebox.module).
Notice: Undefined property: stdClass::$key in homebox_block_edit_form_builder() (Zeile 698 von /var/www/web537/html/kle/sites/all/modules/homebox/homebox.module).

This problem can be fixed by this patch ?

brianV’s picture

Version: 6.x-3.x-dev » 7.x-2.x-dev
Status: Needs work » Fixed

Closing this issue.

@HJulien and milkmaruku :

Please create a separate issue for your problems.

@drufiz: That should be fixed in latest dev.

Michsk’s picture

Status: Fixed » Active

Just updated from 6.2 to 6.3.beta5, this still shows the style attr is undefined.

And the DEV of 6.3 is even worse, full of errors.

brianV’s picture

Status: Active » Fixed

Please open a new ticket. This one is closed.

Michsk’s picture

Status: Fixed » Needs work

But it is the same issue...

brianV’s picture

Status: Needs work » Closed (fixed)

This ticket is cluttered with irrelevant posts, old fixes to old branches which don't work, and other cruft that makes this issue post useless.

Please open a new ticket.

HJulien’s picture

Unfortunately I'm not using Homebox anymore. I couldn't wait any longer.

LiuShaz’s picture

I just added additional condition "$(this).parent('.homebox-column-wrapper').attr('style')" and everything works for me.

Drupal.homebox.equalizeColumnsHeights = function () {
  var maxHeight = 0;
  Drupal.homebox.$columns.each(function () {
    if ($(this).parent('.homebox-column-wrapper').attr('style') && $(this).parent('.homebox-column-wrapper').attr('style').match(/width: 100%/i) == null) {
      $(this).height('auto');
      maxHeight = Math.max($(this).height(), maxHeight);
    }
  }).each(function () {
    if ($(this).parent('.homebox-column-wrapper').attr('style') && $(this).parent('.homebox-column-wrapper').attr('style').match(/width: 100%/i) == null) {
      $(this).height(maxHeight);
    }
  });
};
rickmanelius’s picture

Whatever the history of this issue. The fix in #37 works for me.

HFT’s picture

Version: 7.x-2.x-dev » 6.x-3.0-beta5

For reference, with a fresh install of 6.3 Beta5, the js was broken and setting the custom widths for the columns was all i needed to do to fix it.

mschudders’s picture

StatusFileSize
new1.21 KB

Confirms #37 resolves the problem.

Added the patch so we can add this to the next release.

vectoroc’s picture

StatusFileSize
new750 bytes

I mean different patch