HI,

Just installed nivo slider module and unfortunately I got this error message:

Warning : Invalid argument supplied for foreach() dans nivo_slider_block_view() (ligne 225 dans /homez.467/bridgena/www/sites/all/modules/nivo_slider/nivo_slider.module).
Warning : Invalid argument supplied for foreach() dans nivo_slider_block_view() (ligne 225 dans /homez.467/bridgena/www/sites/all/modules/nivo_slider/nivo_slider.module).
Warning : Invalid argument supplied for foreach() dans nivo_slider_block_view() (ligne 225 dans /homez.467/bridgena/www/sites/all/modules/nivo_slider/nivo_slider.module).
Warning : Invalid argument supplied for foreach() dans nivo_slider_block_view() (ligne 250 dans /homez.467/bridgena/www/sites/all/modules/nivo_slider/nivo_slider.module).

Also i'm trying to resize the slider. I changed the image resize settings but the slider stays at 940 pixels. I don't want more than 900 pixels...
Please check this screenshot http://www.bridgenarbonne.com/Capture%20d%E2%80%99%C3%A9cran%202011-11-24%20%C3%A0%2012.37.24.png

Any help would be appreciated.

Thanks

Comments

tom@lostcowboysathome.be’s picture

Title: Error Invalid argument supplied for foreach() » Notices Undefined index and Warning Invalid argument supplied for foreach()

Hello,

I have a similar problem with nivo-slider. Look at my output below.
Though, managed to hide the error messages by commenting out the lines reffered to but then still the slider won't appear!

Solved your problem yet?

Greetz

Notice: Undefined index: override in nivo_slider_block_view() (line 209 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Notice: Undefined index: override in nivo_slider_block_view() (line 210 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Notice: Undefined index: override in nivo_slider_block_view() (line 211 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Notice: Undefined index: js in nivo_slider_block_view() (line 224 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Warning: Invalid argument supplied for foreach() in nivo_slider_block_view() (line 225 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Notice: Undefined index: override in nivo_slider_block_view() (line 209 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Notice: Undefined index: override in nivo_slider_block_view() (line 210 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Notice: Undefined index: override in nivo_slider_block_view() (line 211 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Notice: Undefined index: js in nivo_slider_block_view() (line 224 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Warning: Invalid argument supplied for foreach() in nivo_slider_block_view() (line 225 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Notice: Undefined index: override in nivo_slider_block_view() (line 209 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Notice: Undefined index: override in nivo_slider_block_view() (line 210 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Notice: Undefined index: override in nivo_slider_block_view() (line 211 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Notice: Undefined index: js in nivo_slider_block_view() (line 224 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Warning: Invalid argument supplied for foreach() in nivo_slider_block_view() (line 225 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).
Warning: Invalid argument supplied for foreach() in nivo_slider_block_view() (line 250 of /home/ivme/domains/ivme.eu/public_html/samw/sites/all/modules/nivo_slider/nivo_slider.module).

alphasupremicus’s picture

Me too. I'm running Drupal 7.9 and I get these same errors as reported in the Issue Summary and the slideshow still shows and is too large for the block region I placed the slideshow in (so it overextends it's area). But just wanna fix the errors first then worry about the size of the slideshow second. Any ideas?

intrafusion’s picture

Category: support » bug

OK I was having the same problem, but I managed to fix it by changing the function nivo_slider_nivo_slider_theme in nivo_slider.module by changing:

<?php
/**
 * Implementation of hook_nivo_slider_theme().
 */
function nivo_slider_nivo_slider_theme() {
  $library_path = libraries_get_path('nivo-slider');

  return array(
    'default' => array(
      'name' => t('Default'),
      'description' => t('The default Nivo Slider theme.'),
      'resources' => array(
        'css' => array (
          $library_path . '/themes/default/default.css',
        ),
      ),
    ),
    'orman' => array(
      'name' => t('Orman'),
      'description' => t('Description of Orman style.'),
      'resources' => array(
        'css' => array (
          $library_path . '/themes/orman/orman.css',
        ),
      ),
    ),
    'pascal' => array(
      'name' => t('Pascal'),
      'description' => t('Description of Orman style.'),
      'resources' => array(
        'css' => array (
          $library_path . '/themes/pascal/pascal.css',
        ),
      ),
    ),
  );
}
?>

to

<?php
/**
 * Implementation of hook_nivo_slider_theme().
 */
function nivo_slider_nivo_slider_theme() {
  $library_path = libraries_get_path('nivo-slider');

  return array(
    'default' => array(
      'name' => t('Default'),
      'description' => t('The default Nivo Slider theme.'),
	  'override' => array(
        'css' => FALSE,
        'js' => FALSE,
      ),
      'resources' => array(
        'css' => array (
          $library_path . '/themes/default/default.css',
        ),
        'js' => array(),
      ),
    ),
    'orman' => array(
      'name' => t('Orman'),
      'description' => t('Description of Orman style.'),
	  'override' => array(
        'css' => FALSE,
        'js' => FALSE,
      ),
      'resources' => array(
        'css' => array (
          $library_path . '/themes/orman/orman.css',
        ),
        'js' => array(),
      ),
    ),
    'pascal' => array(
      'name' => t('Pascal'),
      'description' => t('Description of Orman style.'),
	  'override' => array(
        'css' => FALSE,
        'js' => FALSE,
      ),
      'resources' => array(
        'css' => array (
          $library_path . '/themes/pascal/pascal.css',
        ),
        'js' => array(),
      ),
    ),
  );
}
?>

If I could create patches I would create one for this

gandhi’s picture

very good it works!

alphasupremicus’s picture

StatusFileSize
new1.25 KB

Supplying patch file that implements this fix.

aeroweb340’s picture

thanks for the patch guys. Stil looking on how to resize the slider... not working at all.
Any idea ?

alphasupremicus’s picture

Yeah, I manually edited line 127 of nivo_slider.module and changed the width from 940 to something that worked for my theme and where I placed this block. For me width of 735 was the right value. I presume this sort of thing needs to be auto-calculated by the module (i.e. how large) or use CSS auto-sizing (if possible) or just have an option in the user interface to tweak the width. For now, this manual update works for me.

devin carlson’s picture

Title: Notices Undefined index and Warning Invalid argument supplied for foreach() » Add checks to ensure that options defined by Nivo Slider theme plugins exist before using them
Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Component: User interface » Documentation
Assigned: Unassigned » devin carlson
Priority: Normal » Major
Status: Active » Needs review
StatusFileSize
new4.07 KB

Sorry guys, I thought I was receiving emails for issue queue updates but I wasn't.
Thanks for the error reports everyone and the patch alphasupremicus. It helped track down the cause of the issue.

As for everyone looking for how to adjust the slider's width. You should be able to override the "nivo_slider_slide" image style and do whatever you want with it (change dimensions, add different image effects). You can administer image styles at admin/config/media/image-styles. If that functionality isn't working for you, please create a separate issue.

Additional documentation will be written shortly.

Attached is a patch that corrects the problem outlined in this issue by using only options defined by each Nivo Slider theme (instead of trying to use an option that was never defined).

devin carlson’s picture

Status: Needs review » Fixed

Committed to 7.x-1.x-dev.

I've tagged a new release (beta 2) which should be released shortly.
Please reopen this issue if you are still experiencing problems.

alphasupremicus’s picture

Thanks for the info on how to update the image size. I totally didn't expect it to be there! Great!

Status: Fixed » Closed (fixed)

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