I try to make my draggable views work but I can't, I have this fatal error message when I try to set a number of items to display.

Fatal error: Call to a member function get_minimum_value() on a non-object in /home/pariscin/www/sites/all/modules/draggableviews/draggableviews.inc on line 698.

If it could help... :)

Comments

sevi’s picture

StatusFileSize
new1.02 KB

This patch should display some (more or less) useful information for debugging.

junro’s picture

The patch doesn't work for me, maybe it's normal and you need the draggableviews.inc.rej file.

I'm using Cygwin

patch draggalviews.inc < draggableviews.inc.test.patch
patching file draggableviews.inc
Hunk #1 FAILED at 1.
Hunk # FAILED at 694.
2 out of 2 hunks FAILED -- saving projects to file draggableviews.inc.rej

Here the draggableviews.inc.rej file:

***************
*** 1,5 ****
<?php
- // $Id: draggableviews.inc,v 1.7.2.11 2009/02/16 00:00:05 sevi Exp $

/**
* @file
--- 1,5 ----
<?php
+ // $Id: draggableviews.inc,v 1.7.2.7 2009/01/22 16:05:57 sevi Exp $

/**
* @file
***************
*** 694,699 ****
* the nodes array to number
*/
function _draggableviews_number_serially(&$info) {
// loop through all resulting nodes
$minimum_value = $info['order']['fields'][0]['handler']->get_minimum_value();
for ($i = 0; $i < count($info['view']->result); $i++) {
--- 694,701 ----
* the nodes array to number
*/
function _draggableviews_number_serially(&$info) {
+ drupal_set_message("

".$info['order']['fields'][0]['field_name']."

");
+ drupal_set_message("

".print_r(array_keys($info['order']['fields']), true)."

");
// loop through all resulting nodes
$minimum_value = $info['order']['fields'][0]['handler']->get_minimum_value();
for ($i = 0; $i < count($info['view']->result); $i++) {

sevi’s picture

Ok, I don't know why the patch doesn't work.

But I know why this bug occurs: It always occurs when
1) a view is beeing created (not yet saved) and
2) a saved view is beeing changed (adding/deleting fields).

..currently writing patch..

sevi’s picture

StatusFileSize
new8.1 KB

The attached patch should solve this problem. Draggableviews structure will not be built/saved before the view has been saved. And when editing a view the current settings will be used instead of the saved settings, which also lead to this error.

I hope this patch will help to get rid of these ugly circumstances :)

So far, so good. But in the meanwhile I've to deal with another problem which came with #345647: Conflict between draggable views when using Panels - collision error: The theme registry has to be rebuilt each time a view has been saved because each view uses its own form_id (this makes it possible to differ between many different views on the same page). At the moment I don't know where to place the function call drupal_rebuild_theme_registry(); . For now I call it each time a view is being built (..very ugly :(). If you can't see any nodes you might have to refresh the page once (only within the current circumstance).

greetings, sevi

sevi’s picture

OK, got it now. What I posted above about the theme_registry was a mistake. Views does this. Everything seems to work so far :)

junro’s picture

StatusFileSize
new51.81 KB

Hello,

can't find file to patch at input line 88

see screenshot

junro’s picture

I can't understand why some draggable views work and others don't. It souldn't be the same for all views?

sevi’s picture

Hm, maybe I should split them to separated files.

Anyway, the changes are committed and already for http download available.

sevi’s picture

Doesn't the new version work? Sure, all views should be bug-free, but maybe items_per_page can cause trouble.
I want to bring out a BETA-release in the next few days. So please provide me with bug-information. Let's say: On Monday it must work :)

greetings,
sevi

junro’s picture

ok

Well, I just updated the last dev. version (the seconde one of today), and I've got this error:

Display "Page": Draggableviews: hierarchy field none could not be found (..afterwards removed from Fields section?). Check your settings

and I can't save the view.

I've got this message for all draggable views when I update the draggable style settings.

sevi’s picture

Ok, what a stupid mistake.
The patch makes it better.

junro’s picture

ok! It works! Thanks!

I put the status to Fixed, and I will open a new issue for the next ^^.

junro’s picture

Hum I've got Fatal error: Maximum execution time of 30 seconds exceeded in ...., when I've got to much items to display I think.

With only 10 items, no problems.

sevi’s picture

exceeded in... where?

junro’s picture

in differents modules, each times, the module name change.

I tried again, It works.

I think this message was nothing to do with your module.

junro’s picture

Test: 10 drags:

1 Fatal error: Maximum execution time of 30 seconds exceeded in /home/pariscin/www/modules/user/user.module on line 21

2 GOOD

3 Fatal error: Maximum execution time of 30 seconds exceeded in /home/pariscin/www/sites/all/modules/pathauto/pathauto.inc on line 481

4 Fatal error: Maximum execution time of 30 seconds exceeded in /home/pariscin/www/sites/all/modules/pathauto/pathauto.inc on line 145

5 GOOD

6 GOOD

7 GOOD

8 GOOD

9 GOOD

10 GOOD

11 GOOD well it seems to work... no fatal error anymore... I don't know what could do that. Maybe my serveur settings or I don't know....

12 Fatal error: Maximum execution time of 30 seconds exceeded in /home/pariscin/www/sites/all/modules/pathauto/pathauto.inc on line 147

13 SURPRISE:

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.8g Server Port 80

14 Fatal error: Maximum execution time of 30 seconds exceeded in /home/pariscin/www/sites/all/modules/pathauto/pathauto.inc on line 147

15 Fatal error: Maximum execution time of 30 seconds exceeded in /home/pariscin/www/sites/all/modules/pathauto/pathauto.inc on line 452

junro’s picture

I recreated from scratch one of my 2 biggest draggable views and they seem to work fine. ^^

sevi’s picture

Hmm,
I think I know why the "Maximum execution time" error occurs. Each time a view is broken all nodes have to be renumbered. So the entire view (all X rows) will be loaded and the save function will be called X times. Especially in case of CCK-fields this needs a lot of performance.

I believe the progress of renumbering can be done with a single SQL statement instead of covering each row separately (with big overhead).

I'll try to make a patch.
You still have these errors, right?

sevi

junro’s picture

I don't have the m"maximum execution time" errors anymore, I think this is because the draggable views is not broken anymore.
I will check this with the next broken structure.

sevi’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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