When trying to build a slideshow in Drupal 6 with

  • Views 6.x-3.x-dev (2011-10-25)
  • Views_Slideshow 6.x-3x-dev (2011-10-25)

you may receive the following error:

An error occurred at /admin/build/views/ajax/preview/slideshow_front.

Error Description:
Fatal error: Call to a member function get_row_class() on a non-object in /home/*/public_html/sites/all/modules/views_slideshow/contrib/views_slideshow_cycle/theme/views_slideshow_cycle.theme.inc on line 187

    172 function _views_slideshow_cycle_preprocess_views_slideshow_cycle_main_fr        ame_row_item(&$vars) {
    173   $classes = array('views-row views-row-' . $vars['item_count']);
    174   if (!$vars['item_count']) {
    175     $classes[] = 'views-row-first';
    176   }
    177   if ($vars['item_count'] % 2) {
    178     $classes[] = 'views-row-even';
    179   }
    180   else {
    181     $classes[] = 'views-row-odd';
    182   }
    183
    184   /**
    185    * Support custom row classes.
    186    */
    187   if ($row_class = $vars['view']->style_plugin->get_row_class($vars['item_count'])) {
    188     $classes[] = $row_class;
    189   }
    190
    191   $vars['attributes']['class'] = implode(' ', $classes);
    192 }

Comments

redndahead’s picture

Status: Active » Postponed (maintainer needs more info)

I think I fixed that this morning. You may need to wait for the dev release to update again. Report back if you still have problems.

boobaa’s picture

Version: 6.x-3.x-dev » 7.x-3.0
Priority: Normal » Critical
Status: Postponed (maintainer needs more info) » Active

The just-released 7.x-3.0 has the same bug. Raising to critical according to the priority levels description: this bug renders the site unusable (I have a views_slideshow block on the front page, which now does not display at all, but shows only a fatal error and a backtrace.)

redndahead’s picture

Is this on upgrade? From what version to what version? Did you clear the cache?

greenskunk’s picture

redndahead's update for the 6.x-3.x-dev (2011-10-26) version worked for me! Check out the slideshow on Amish Trail's homepage http://AmishTrail.com

czigor’s picture

The same issue here. After an update from 7.x-3.0-alpha1 to 3.0, my site went WSOD. I had a slideshow block on the right sidebar, switching that off got my site back alive. I have commented out the lines 183-185 in views_slideshow_cycle.theme.inc and I could turn the slideshow block back on. Checking the $vars variable in

$vars['view']->style_plugin->get_row_class($vars['item_count']

showed that $vars['view'] is NULL.

philsward’s picture

Same error... I didn't get the error with the dev from Dec 2011, but the updated version back in March caused this issue. I can't remember if I cleared the cache or not, I'm sure I did, but that didn't help. I rolled back to the Dec Dev.

Running into some issues after some slideshow changes, I decided to check the slideshow view. This would take me to the proper /edit/slideshow, but then redirected me to /nojs/preview/slideshow... I figured the views update I did a few days before might have had some major bugs, so I updated the views dev again. No fix. This left me with trying the newer versions of views slideshow dev. When I upgraded, I immediately got the same error. Cleared the Cache and it fixed the problem. So I thought... Turns out the fix was really only temporary for me. Wait 5 min, check the page with the slideshow and same error. I rolled back to the Dec dev (thanks drush!) and figured all was well again. However, even the rollback version started doing it. Clearing the cache wouldn't even fix it this time. (Might have been boost, apc or something with caching...)

I did what czigor suggested, which was to comment out some lines in the views_slideshow_cycle.theme.inc.

For my situation, I had to do lines 187 - 189

I'll note that I am using the 3.x-dev version for D6, not D7 (versions share some code I'm sure...)

nickdickinsonwilde’s picture

Issue summary: View changes
Status: Active » Closed (outdated)