Hi,

after upgrading to 6.x-1.0-beta2, image (sub) galleries stopped working on my D6 site. Accessing ./image outputs the usual list of sub-galleries with icons and some descriptive data; this works as well with the image-gallery-view as without it. Sub-galleries became inaccessible; views-based sub-galleries fail with an "Access denied" message (browsing the site as user #1!); without the views enabled I'm getting a blank page. In this case watchdog registers an error:

call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'image_gallery_page' was given in /var/www/drupal/includes/menu.inc in Zeile 348.

This error is mentioned by Hetta in #8 of #210122: Rewrite image_gallery to use of Taxonomy's admin ui (more or less unresolved/pending), and it also occurs in many Views related issues. I've no idea what it means.

In my D6 setup I'Ve got two image_gallery related views:

* image_gallery (Standard Node view; description: "The default gallery of image nodes from Image gallery module"; provides the path "image")
* image_gallery_terms (Standard Term view; descrition: "The default list of descendant galleries from Image gallery module. Displayed within the image gallery view."; provides no path)

I don't know which one of these vews belongs to image.module, and I alos don't know if these Views are recent or legacy. I disabled both but the behaviour described above still applies.

On another (D5) site I had a similar (but quite different) problem which could be solved with Joachim's help (cf. #207371: There are no images in this gallery.); those tips seem no longer to apply for the recent D6 versions of image.module, so I'm pretty much stuck here.

Any ideas or suggestions?

Thanks & greetings, -asb

Comments

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

Both these views are needed for the image galllery to work with views. If the descriptions could be clearer, I would welcome suggestions or even a patch.

It all works perfectly on my site.
Please could you try:
1. Clearing the menu cache.
2. Backtracing from the point of the error message to see where the problem actually lies.

asb’s picture

Hi,

> Both these views are needed for the image galllery to work with views.

OK, both views are re-enabled.

* Going to ./image displays: (sub-) galleries, thumbnails, and some metadata through a view
* clicking on one of the (sub-) galleries, e.g. ./image/tid/1974 or ./image/tid/1917, results in a blank (white) page

Watchdog registers for location ./image/tid/1974 the error: call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'image_gallery_page' was given in /var/www/drupal/includes/menu.inc in Zeile 348., that's it.

> 1. Clearing the menu cache.

Done through Admin menu, no change. I was using the DHTML menu module, disabled it. Tried to clear the Views cache at ./admin/build/views/tools/basic, also no changes.

> 2. Backtracing from the point of the error message to see where the problem actually lies.

Backtracing? Sounds like devel.module or coding. If you could point me to instructions what I have to do?

And sorry, I've no idea how to reproduce this (this is my first live D6 site, everything else I'm doing is still D5 or Imagefield-based, so I haven't got much to compare).

Thanks & greetings, -asb

Edit: Even though this site is just a few months old it seems to "degrade" itself completely; I just noticed that disabled modules no longer can be uninstalled (uninstall confirmation simply repeates over and over again without uninstalling the selected module); also I noticed that Views Bulk Operations are no longer executed (similar to uninstalling modules the confirmation dialogue simply has fun in a loop). Probably there would be more issues if I'd check out functionality more systematically. Most probably the breakdown of the new views-based image galleries is nothing but a indicator for an upcoming Drupal breakdown (uninstalling modules is a core functionality), so it's not worth your time trying to analyze the image.module part of the problem. At least I'm giving up for the moment since issues of this magnitude are far beyond my horizon of understanding ;-(

joachim’s picture

Well it does sound like your whole install might be on the blink -- maybe some other module has totally fried things?

The debug thing -- at its simplest, I meant just shove in:
print_r(debug_backtrace()); just before the bad line
However -- because menu stuff is called HEAPS, that will kill your memory. So I would wrap that statement in a check for the offending value.
However -- again -- a search of the code shows that 'image_gallery_page' is only used in two places.
So it's basically that the image_gallery.pages.inc file isn't being loaded. Can you check you have it in the contrib/image_gallery folder?

asb’s picture

> So it's basically that the image_gallery.pages.inc file isn't being loaded.
> Can you check you have it in the contrib/image_gallery folder?

$/var/www/drupal/sites/all/modules/image/contrib/image_gallery# ls -lah
...
drwxr-xr-x 2 1080 1080 4,0K  5. Sep 20:10 help
-rw-r--r-- 1 1080 1080 8,3K  4. Sep 09:39 image_gallery.admin.inc
-rw-r--r-- 1 1080 1080 1,1K 27. Aug 14:10 image_gallery.css
-rw-r--r-- 1 1080 1080  396  5. Sep 20:10 image_gallery.info
-rw-r--r-- 1 1080 1080 3,2K  5. Sep 12:39 image_gallery.install
-rw-r--r-- 1 1080 1080 7,7K  4. Sep 15:24 image_gallery.module
-rw-r--r-- 1 1080 1080 5,7K  4. Sep 15:24 image_gallery.pages.inc
...

> The debug thing -- at its simplest, I meant just shove in:
> print_r(debug_backtrace()); just before the bad line

Line 348 in /var/www/drupal/includes/menu.inc reads:

return call_user_func_array($router_item['page_callback'], $router_item['page_arguments']);

Putting print_r(debug_backtrace()); before this line gives me, when clicking on a sub-gallery, a blank page with the following textual output:

Array ( [0] => Array ( [file] => /var/www/drupal/index.php [line] => 18 [function] => menu_execute_active_handler [args] => Array ( ) ) )

Does this help?

Thanks & greetings, -asb

joachim’s picture

Try print_r($router_item);
You should see a file key.
If not -- either your menu cache still hasn't been cleared or your system is broken, I think :(

asb’s picture

> Try print_r($router_item);

The wonders of programming ;) I'm getting:

Array ( [path] => image/tid/% [load_functions] => Array ( [2] => ) [to_arg_functions] => [access_callback] => user_access [access_arguments] => a:1:{i:0;s:14:"access content";} [page_callback] => image_gallery_page [page_arguments] => Array ( [0] => tid [1] => 1917 ) [fit] => 6 [number_parts] => 3 [tab_parent] => [tab_root] => image/tid/% [title] => Image galleries [title_callback] => t [title_arguments] => [type] => 4 [block_callback] => [description] => [position] => [weight] => 0 [file] => [href] => image/tid/1917 [options] => Array ( ) [access] => 1 [localized_options] => Array ( ) [map] => Array ( [0] => image [1] => tid [2] => 1917 ) )

Is this a "file key"?

Greetings, -asb

joachim’s picture

The bit we want is
[file] =>
and it's empty. It shouldn't be.

So: either your image_gallery.module file is corrupt or your database is.

Your file should have this in it:

/**
 * Implementation of hook_menu().
 */
function image_gallery_menu() {
  $items = array();

  $items['image'] = array(
    'title' => 'Image galleries',
    'access arguments' => array('access content'),
    'type' => MENU_SUGGESTED_ITEM,
    'page callback' => 'image_gallery_page',
    'file' => 'image_gallery.pages.inc', <------- this is the line your system seems to not be picking up!
  );
asb’s picture

Hi,

# drush dl image-6.x-1.0-beta
Project image (6.x-1.0-beta2) downloaded to /var/www/drupal/sites/all/modules/.

Behaviour remains the same, so the database is corrupt. Just fu***ng great ;-/

According to ./admin/reports/status everything if fine, update.php has neither pending updates nor errors. However, disabling and then uninstalling "memcache" module fixed both other errors mentioned above. Some (now again possible) large VBO operations brought another long-standing issue into memory (#331625: foreach/sql errors when creating CCK fields):

Fatal error: Call to undefined function relevant_content_cck_content_is_empty() in /var/www/drupal/sites/all/modules/cck/content.module on line 906

So let's get rid of the "Relevant Content" module, and a bunch of other large modules like "Devel" and "Panels", also. Image Galleries still are not showing up. So the site is broken; should we set this to "won't fix"?

Thanks & greetings, -asb

joachim’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Closed (fixed)

> However, disabling and then uninstalling "memcache" module fixed both other errors mentioned above.

Told you it was caching ;)

As for your CCK thing -- out of this module's scope.

Setting this as a closed support request, as it was just a caching problem that needed to update for the changed menu stuff in the latest release.

asb’s picture

Status: Closed (fixed) » Closed (won't fix)

Sorry, this is a misunderstanding; I was able to fix two other issues on the site (VBO, uninstalling modules; mentioned in #2) which could have indicated a general breakdown of the Drupal installation or might have been involved in obstructing image galleries. However, those issues were not related to image.module, as the "Relevant Content" also isn't related to my image.module's problem (disabled "Relevant Content", image galleries still don't show up; solving theese issues resp. disabling the mentioned modules didn't made image galleries working again, so they're most probably not related; also, watchdog log doesn't show any other errors except those produced by image.module) .

Bottomline: Everything else appears to be working properly again, except image galleries. Image galleries did not show up after disabling and uninstalling Memcache module. Thus I'm setting this to "won't fix" (since I can't provide the means to replicate) and will post a follow-up issue in the menu system's issue queue (the error in the watchdog log indicates a problem with menu router, so this would be the obvious choice if a problem inside of image.module can be excluded like stated in #7, right?).

Edit: Follow-up issue in the menu system issue queue: #574012: call_user_func_array() in menu.inc breaks image gallery

Thanks & greetings, -asb

asb’s picture

Status: Closed (won't fix) » Fixed

I've moved #574012: call_user_func_array() in menu.inc breaks image gallery from the menu system issue queue to to the "Edit term" issue queue - that was the bad boy. D6 Galleries are working again now for me!

Greetings, -asb

Status: Fixed » Closed (fixed)

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