More than one slider node type causes errors on all nodes

jshubow - February 19, 2009 - 15:08
Project:Slider
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Mark Theunissen
Status:closed
Description

I'm getting "An error has occurred while trying to create this slider" but not seeing anything wrong or seeing any log errors. What would cause this and where can I get more info on the exact nature of the error??

#1

Mark Theunissen - February 20, 2009 - 09:39

That message is displayed when the Slider has no attached nodes. Either that, or you've named the nodereference field incorrectly. Check to see if you've followed the instructions.

#2

jshubow - February 24, 2009 - 21:26

Hmmm. I *think* I followed everthing correctly. I'm getting the message on all nodes, even ones that have nothing to do with the slider.. Slider has 3 stories works fine with images or stories

here is what I have in the manage fields page for the content type:

Slider _add_new_group field_slider_content Node reference Configure Remove

Any help would be appreciated.

Also will this work with a block?

#3

jshubow - February 24, 2009 - 21:54

Also when trying to get it to show up on the homepage I get the info about the slider, not the slider.

Featured Slider
February 19, 2009 - 2:53pm — Jonathan Shubow Slider:
Culmination of a lifetime of work
South Shore Inaugural Ball
Teen voices from the Obama inauguration

#4

Mark Theunissen - February 25, 2009 - 09:36

You can't display a Slider as a teaser, so that's what your second issue is.

As for the first, I simply don't know. As long as you have a field_slider_content that is a nodereference, you shouldn't get the error.

#5

Mark Theunissen - February 25, 2009 - 11:46
Status:active» fixed

Never mind, think I've found the problem!

I fixed it in today's -dev tarball, can you confirm it's working please?

#6

jshubow - February 25, 2009 - 20:47

Nope, sorry.

Downloaded, installed, updated, cleared cache.... getting it on all nodes, no matter if slider enabled or not... new drupal installation.

I'm happy to give you access. I sent you my email address.

#7

Mark Theunissen - February 25, 2009 - 21:18

Are you still getting the same error message? Or has it changed?

#8

Mark Theunissen - February 25, 2009 - 21:24

Wait, I think I know what may be causing this. If you go to admin/settings/slider, which node types are ticked?

You should only have the *slider* node type selected. You shouldn't select page, story, or any others (ie. the ones that you want to appear as slides within the slider). Because then the system will attempt to turn them into sliders, which will fail.

However, thinking about it, the module shouldn't let you anyway.

#9

Mark Theunissen - February 26, 2009 - 09:22
Title:receiving error message but seems to be working fine» More than one slider node type causes errors on all nodes
Component:Miscellaneous» Code
Assigned to:Anonymous» Mark Theunissen

Due to PHP's in_array() function not behaving sanely (i.e. returning true when comparing integer 0 to any string), the following line breaks if you have more than 1 slider node type:

if (in_array($node->type, $slider_types)) {

You actually need to force "strict mode" and thus the line becomes:

if (in_array($node->type, $slider_types, TRUE)) {

http://venutip.com/content/assumptions-and-errata-two-quick-tips

Will be in the 1.3 release.

#10

System Message - March 12, 2009 - 09:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.