if you didn't pick a caption and main_image fields you will get one of these notices...

Notice: Undefined index: cation in views_slideshow_royalslider_views_pre_render()
Notice: Undefined index: main_image in views_slideshow_royalslider_views_pre_render()

the workaround here is to choose a caption and main_image fields save your changes, then return these back to none and save again.

Comments

mqanneh’s picture

use this patch, it worked for me

mqanneh’s picture

Issue summary: View changes
mqanneh’s picture

Status: Active » Needs review

alexweber’s picture

Status: Needs review » Fixed

I'd run into something similar a while back and I can't remember why exactly but we decided to leave it but yeah it's annoying, so let's fix it!

Thanks for the patch!

Status: Fixed » Closed (fixed)

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

johnpicozzi’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta6
Status: Closed (fixed) » Needs review
StatusFileSize
new1.53 KB

Hello - I am having the same issue with the latest version of the module (beta 6). I was able to address the issue by changing the if's from array_key_exists to !empty. I have attached a patch (based on beta 6) for review.

Status: Needs review » Needs work

The last submitted patch, 7: royalslider-notice-undefined-indexes-2292395-7.patch, failed testing.

johnpicozzi’s picture

Here is a patch against the 7.x-1.x branch as well.

johnpicozzi’s picture

thijsvdanker’s picture

Thanks @johnpicozzi checking for !empty checks the missing cases better then the array key checks.
Committed to 7.x-1.x.

thijsvdanker’s picture

Status: Needs work » Fixed
chroid’s picture

I can confirm that this patch fixes this same issue for me.

Notice: Undefined index: in views_slideshow_royalslider_views_pre_render() (line 29 of /royalslider/contrib/views_slideshow_royalslider/views_slideshow_royalslider.module)

Notice: Trying to get property of non-object in views_slideshow_royalslider_views_pre_render() (line 30 of /royalslider/contrib/views_slideshow_royalslider/views_slideshow_royalslider.module).

Notice: Undefined property: stdClass::$options in views_slideshow_royalslider_views_pre_render() (line 30 of /royalslider/contrib/views_slideshow_royalslider/views_slideshow_royalslider.module).

Notice: Undefined index: element_class in views_slideshow_royalslider_views_pre_render() (line 30 of /royalslider/contrib/views_slideshow_royalslider/views_slideshow_royalslider.module).

Warning: current() expects parameter 1 to be array, null given in views_slideshow_royalslider_views_pre_render() (line 38 of /royalslider/contrib/views_slideshow_royalslider/views_slideshow_royalslider.module).

I'm defining a views slideshow based Royalslider formatter in my view and for reasons I won't go into (using DisplaySuite on the other side) I'm not using either of the 'Image' nor 'Caption' settings, so they are both set to '- None -'.

Patch resolves these notices/warnings immediately. Thanks!

Status: Fixed » Closed (fixed)

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