Notice: Undefined index: in template_preprocess_views_slideshow() (line 14 of /home/cmcpaserby/domains/13dragonstudio.com/public_html/sites/all/modules/views_slideshow/theme/views_slideshow.theme.inc).

anyone got a clue i just made a block view that uses the views_slideshow in drupal 7.x and i get this php error.

yes i know it is alpha i just really want to get this working since i used it a lot back with drupal 6.x

Comments

cmcpasserby’s picture

Status:Active» Closed (fixed)
antonyanimator’s picture

I'm having the same problem, how did you get it working?

antonyanimator’s picture

Priority:Normal» Major
Status:Closed (fixed)» Active
redndahead’s picture

That error would make it seem the view isn't being passed in. Maybe don't have the right version of views with the right version of views_slideshow

antonyanimator’s picture

Thanks for the reply, I have views 7.x-3.0-alpha1 with slideshow 7.x-3.x-dev. I'll try a different version of views

antonyanimator’s picture

Title:Notice: Undefined index: in template_preprocess_views_slideshow()» I updated views to the latest dev and get even more errors

Get this now too:

* Warning: array_merge() [function.array-merge]:

Maybe I should revert back

antonyanimator’s picture

I don't get why I get this problem and no one else has, are people using drupal 7.0 or are they using the dev version?

antonyanimator’s picture

I don't get why I get this problem and no one else has, are people using drupal 7.0 or are they using the dev version?

redndahead’s picture

Can you give me more of what that error says? should have a line number. Warnings shouldn't stop it from working though.

antonyanimator’s picture

Title:I updated views to the latest dev and get even more errors» Notice: Undefined index: front_page-block_1 in template_preprocess_views_slideshow() (line 19 of /opt/lampp/htdocs/d7_aps/sites/

Notice: Undefined index: front_page-portfolio_slideshow in template_preprocess_views_slideshow() (line 19 of /opt/lampp/htdocs/d7_aps/sites/all/modules/views_slideshow/theme/views_slideshow.theme.inc).

This is the error I get.
I'm using:

Views 7.x-3.0-alpha1
Views Slideshow 7.x-3.x-dev

The slideshow is working correctly, I'm using a block display, I get this error on any page the block is displayed on.

Thanks

gresda’s picture

I updated views and views_slideshow with the today's versions, and now I have the same issue with 3 blocks using views_slideshow:

* Notice: Undefined index: block_services-block_1 dans template_preprocess_views_slideshow() (ligne 19 dans /srv/www/htdocs/d7/sites/all/modules/views_slideshow/theme/views_slideshow.theme.inc).
* Notice: Undefined index: news_list-block_1 dans template_preprocess_views_slideshow() (ligne 19 dans /srv/www/htdocs/d7/sites/all/modules/views_slideshow/theme/views_slideshow.theme.inc).
* Notice: Undefined index: slider_accueil-block_1 dans template_preprocess_views_slideshow() (ligne 19 dans /srv/www/htdocs/d7/sites/all/modules/views_slideshow/theme/views_slideshow.theme.inc).

mjgruta’s picture

Title:Notice: Undefined index: front_page-block_1 in template_preprocess_views_slideshow() (line 19 of /opt/lampp/htdocs/d7_aps/sites/» Undefined index: in template_preprocess_views_slideshow() line 19 - $instances[$vss_id]++;

I also experience this but only when i'm not logged in as an admin/user.
I don't have any problems except with this * Notice: Undefined index:.
I also updated my views & vews_slideshow to feb 28 dev.

I use my old views_slideshow to revert it back and the problem is gone, then I checked the codes and see that on line 19 on the latest dev they added this part below $vss_id = $view->name . '-' . $view->current_display;

<?php
$vss_id
= $view->name . '-' . $view->current_display;
 
$instances[$vss_id]++;
  if (
$instances[$vss_id] > 1) {
   
$vss_id .= "_" . $instances[$vss_id];
  }
?>

I don't know what this code means because i'm still a newbie but I think you can temporary bypass it by removing the said code or changing the code to this someone fix this.

<?php
$vss_id
= $view->name . '-' . $view->current_display;
 
/*$instances[$vss_id]++;
  if ($instances[$vss_id] > 1) {
    $vss_id .= "_" . $instances[$vss_id];
  }*/
?>

so far, I don't have any problems.

mjgruta’s picture

Title:Undefined index: in template_preprocess_views_slideshow() line 19 - $instances[$vss_id]++;» Undefined index: in template_preprocess_views_slideshow() line 19 - $instances[$vss_id]++

EDIT: Double post

sayela’s picture

I experienced the same problem. What I did to get around this was to comment out this:

/**
$instances[$vss_id]++;
if ($instances[$vss_id] > 1) {
$vss_id .= "_" . $instances[$vss_id];
}
*/

in line 19 of: sites/all/modules/views_slideshow/theme/views_slideshow.theme.inc

Don't really know the effect though but it worked for me very fine for now.

antonyanimator’s picture

Beautiful! Works for me, thanks Sayela appreciate it!

redndahead’s picture

Must have been a bug in my last commit. That code is only really useful if you have the same slideshow on the same page. So commenting out shouldn't hurt most people

ronan’s picture

Component:Miscellaneous» Code
Category:support» bug
Priority:Major» Normal
Status:Active» Needs review
StatusFileSize
new882 bytes

Here's a patch that fixes the issue without removing the code.

halley’s picture

Thank you. It realy work :)

eosrei’s picture

Status:Needs review» Reviewed & tested by the community
StatusFileSize
new880 bytes

Updated patch from #17 to apply from module root. Works as described.

vasike’s picture

it works.

cmcpasserby’s picture

thanks a bunch of the patch

the issues came back up when i updated this modual and the patch helped out.

jaialin’s picture

#19 works. Thanks!

deepbluesolutions’s picture

#19 works for me too

mattcasey’s picture

just found this problem and removing those lines worked

redndahead’s picture

Status:Reviewed & tested by the community» Needs review
StatusFileSize
new559 bytes

Can you test this patch it's a little bit smaller.

alphakom’s picture

Patch in #25 fixed the same problem for me. (Using Views 7.x-3.0-alpha1 and Views Slideshow/Cycle 7.x-3.x-dev.)

gghh2’s picture

#19 is fine ;)

redndahead’s picture

Status:Needs review» Fixed

This has been committed. Thank you everyone.

antonyanimator’s picture

Status:Fixed» Active

sorry to reopen this, but I get this in the newest release:

Error
Notice: Undefined index: in template_preprocess_views_slideshow() (line 14 of C:\localserver\xampp\htdocs\d7_aps\sites\all\modules\views_slideshow\theme\views_slideshow.theme.inc).

Also the slideshow doesn't display at all

redndahead’s picture

Status:Active» Fixed

Grr I should have caught that. I comitted a fix. Here is the diff for it http://drupalcode.org/project/views_slideshow.git/blobdiff/c5d56ddf3debb...

antonyanimator’s picture

Status:Fixed» Active

Sorry redndahead, it didn't work for me, still getting this error:

Notice: Undefined index: in template_preprocess_views_slideshow() (line 14 of C:\localserver\xampp\htdocs\d7_aps\sites\all\modules\views_slideshow\theme\views_slideshow.theme.inc).

This is what is in my file:

function template_preprocess_views_slideshow(&$vars) {
static $instances = array();
$options = $vars['options'];
$main_frame_module = $options['slideshow_type'];
$settings = $options[$main_frame_module];
$view = $vars['view'];
$rows = $vars['rows'];
$num_divs = count($rows);
$vss_id = $view->name . '-' . $view->current_display;
$instances[$vss_id] = isset($instances[$vss_id]) ? $instances[$vss_id]++ : 0;
if ($instances[$vss_id] > 1) {
$vss_id .= "_" . $instances[$vss_id];
}

Which I could help out, just don't have the knowledge yet.
Thanks for your hard work

redndahead’s picture

This is another problem that should be in another issue, but the gist of that error is there is no slideshow type chosen. Do you have Views Slideshow Cycle module enabled?

antonyanimator’s picture

Status:Active» Closed (fixed)

I'm sorry, its my fault, I resaved the block I had created and everything is back to normal, sorry for wasting your time

arbel’s picture

I think there's a mistake in the syntax...it doesn't quite work.

here's my fix:

  if(isset($instances[$vss_id]))
    $instances[$vss_id]++;
  else
    $instances[$vss_id] = 1;

I'm not sure why the shorthand didn't work but when using the shorthand all the $instances[$vss_id] values where 1 (I tested this with a view with multiple slideshows).

redndahead’s picture

Did you test a view with multiple of the exact same slideshow?

arbel’s picture

yes,

I have a view with a slideshow.
I have a node with a view reference field that refrences that views slideshow (with an argument to limit the results).
Then I have another view that loads a bunch of nods (those with the view's refrence)
so essentially I"m loading the same view a few times.

you can take a look here:

http://premiumbaby.co.il/koziol/drupal-7.0/list

When I used your patch the controls for all the slideshows affected only the first slideshow. and I printed out this $instances[$vss_id] and saw that it was all 1

so I tried to play with it and replaciing the shorthand syntax with a full one worked....

Idan

Aeotrin’s picture

I am still getting the error
Notice: Undefined index: in template_preprocess_views_slideshow() (line 14 of C:\localserver\xampp\htdocs\d7_aps\sites\all\modules\views_slideshow\theme\views_slideshow.theme.inc).

Just a simple view, all settings are the same as in the d7 tutorial, and no slideshow appears in the block on the front page.

Patches applied and dev versions on views, views_slideshow and ctools are being used.

Aeotrin’s picture

Well I reverted my view, and saved. No Error.

redndahead’s picture

StatusFileSize
new982 bytes

@arbel Can you test this patch please?

arbel’s picture

is there a problem with the change I did in #34 ?

that fixed the problem for me?

against what is the patch?

Thanks

Idan

redndahead’s picture

@arbel No it's about the same. I just moved some pieces to make the code cleaner. I just wanted to make sure in doing that I didn't create any other issues. You can apply it against the latest dev, but the gist of it is replace

  if(isset($instances[$vss_id]))
    $instances[$vss_id]++;
  else
    $instances[$vss_id] = 1;

  if ($instances[$vss_id] > 1) {
    $vss_id .= "_" . $instances[$vss_id];
  }

with

  if (isset($instances[$vss_id])) {
    $instances[$vss_id]++;
    $vss_id .= "_" . $instances[$vss_id];
  }
  else {
    $instances[$vss_id] = 0;
  }
redndahead’s picture

A fix has been committed.

angramify’s picture

is the fix committed in the alpha version or in the dev version?
I just installed the alpha version and views 7.x-3.0-beta3
and I'm getting this notice
Undefined index: in template_preprocess_views_slideshow() (line 14...)

redndahead’s picture

Should be the dev version.

3rdLOF’s picture

Lastest DEV of views as of today:

Notice: Undefined index: in template_preprocess_views_slideshow() (line 13 of /Users/natuk/Sites/drupal7/sites/all/modules/views_slideshow/theme/views_slideshow.theme.inc).
Warning: Invalid argument supplied for foreach() in template_preprocess_views_slideshow() (line 47 of /Users/natuk/Sites/drupal7/sites/all/modules/views_slideshow/theme/views_slideshow.theme.inc).

kriskhaira’s picture

Status:Needs work» Closed (fixed)

This problem appears for me with both 7.x-3.x-dev and 7.x-3.0-alpha1; and with or without the patch.

Notice: Undefined index: in template_preprocess_views_slideshow() (line 13 of /Users/kris/DEV/imii/sites/all/modules/contrib/views_slideshow/theme/views_slideshow.theme.inc).
kriskhaira’s picture

Status:Closed (fixed)» Needs review
kriskhaira’s picture

Status:Needs review» Needs work
redndahead’s picture

Status:Closed (fixed)» Fixed

I have made a commit that will throw a better error message. Do you have views slideshow cycle enabled? The gist of it is there is no main slideshow module specified.

kriskhaira’s picture

Thanks! I missed the "no Views Slideshow plugin enabled" error because it was quite inconspicuous.

Shubin’s picture

I'm pretty new to Drupal, so I'm lost as to how to apply this patch.

Help greatly appreciated.

redndahead’s picture

Unless you need it immediately I would wait until tomorrow when the latest development release is made. Or more than likely just enable views slideshow cycle.

kriskhaira’s picture

Shubin, I ended up using Views Slideshow 7.x-3.x-dev without any patches. Make sure both views_slideshow and views_slideshow_cycle are enabled. And in your View, check inside the "Settings" page next to the Slideshow link for any errors.

spovlot’s picture

Subscribing. Same problem.

Status:Fixed» Closed (fixed)

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

nicoz’s picture

sub. same

aosiname’s picture

tried this but it doesnt work because the problem occurs on line 14...?

aosiname’s picture

ok heres how i got it working

I am using
views 7.x-3.0-beta3
Views Slideshow 7.x-3.0-alpha1
Views Slideshow: Cycle 7.x-3.0-alpha1
Views UI 7.x-3.0-beta3

no patches added at all.
The reason it happened was because of the dialog widget that you do the settings in for the views slideshow.

The scroller failed to appear so i couldnt do all the settings way down the bottom or even click apply
I thought you just click the x to save changes.

So i guess something was not set therefore I got the message.

I disabled all modules above and reenabled
Used tab to get to the options way down bottom in the dialogue window.
This worked for me.

watman’s picture

I had this problem when I added a new view and selected create a block and slideshow as my display format on that initial screen. After I edited the view and change settings in the format section, the slideshow worked and the error went away.

mrryanjohnston’s picture

I still run into this issue:

Notice: Undefined index: in template_preprocess_views_slideshow() (line 14 of /srv/http/drupal/sites/all/modules/views_slideshow/theme/views_slideshow.theme.inc).

Edit:
Installed dev version of the module. Seemed to do the trick.

kriskhaira’s picture

@mrryanjohnston, you can tell whether a fix has been rolled into a version other than dev by comparing the release date and the date a ticket was changed to fixed.

In this case, Views Slideshow 7.x-3.0-alpha1 was released on 2011-Mar-12 but the fix was committed on April 5, 2011 (see comment #49).

ecommercium’s picture

Idem #60! brought back the slides without errors!

delboard’s picture

It seems that the error (Notice: Undefined index: in template_preprocess_views_slideshow() (line 14 of ...\sites\all\modules\views_slideshow\theme\views_slideshow.theme.inc) occurs if I select the format "Slideshow" when I first create a new view.
If you select some other format first and then change it to Slideshow, it works fine.

Maybe that helps..

werfu’s picture

I've found that this error happens when you enable the View Slideshow module without any Slideshow submodule like View Slideshow Cycle. Simply enable one, than go into the view, edit the view parameter and set the display parameter of the Slideshow to use the one you've just enabled. It did the trick for me!

BuFr’s picture

#63 works for me

sionescu’s picture

#63 happens to me because i was missing jquery.cycle.all.min.js in the libraries folder

jorisx’s picture

#63 worked :)
also had Format: Show panel fields selected, now changed it to just fields and it works :)

Net Mystic’s picture

I was having the same problem for awhile. After spending a whole day trying to debug this, I finally realized that I had used the Field Permissions module to limit viewing of the slideshow fields to certain roles (with the intention of preventing unauthorized users from editing slideshow fields in the node edit form). Once I turned on the "View anyone's value for field Slide Image" permission for all roles, the slideshow works fine!

If you've activated the Field Permissions module, this may be your solution! Hope this helps!

~ Net Mystic