I was hoping to use this module in conjunction with the Scheduler module to publish and unpublish the applicable nodes I need, but I have discovered when using the B/I Random mode (I would have all nodes unpublished except the one I want to use), unpublished nodes are still used.

If I have a bunch of nodes that are unpublished and only 1 is published, when using Random mode, shouldn't the published node be the only one that meets the criteria and thus be the one that gets displayed?

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

GuyManDude’s picture

Issue summary: View changes

I have subsequently found that when not using the Random mode, background images are still randomly displayed from nodes of the content type even when they are unpublished. A simple page refresh reveals this.

Please take the time to fix this problem if it is a simple remedy. This would be an excellent module if it worked properly...

Best Regards,
-GuyManDude

GuyManDude’s picture

I'm not sure why I didn't try this sooner but the Dev build seems to work as expected. I need to do some more testing but preliminary tests have it randomizing on random only and fixed paths have the stationary image they are supposed to.

GuyManDude’s picture

The random mode still displays content from non-published nodes after all. Hopefully this this not the expected result. It would be great if the random mode could be set to pull content from published only nodes so we have more control over what gets displayed. Is this the expected result or can we look forward to a switch that would turn it on and off?

genjohnson’s picture

Status: Active » Needs work
FileSize
432 bytes

I've run into this issue and expect content that is unpublished to not be publicly displayed. Here's a one-line patch that adds the condition that nodes must be published to be randomly selected.

However, this seems like only part of a larger issue of how unpublished background image nodes are handled. Two other situations related to unpublished nodes I'd like to see addressed as part of this issue are:

  1. Assuming that unpublished nodes should not be publicly displayed, unpublished nodes should not be available in the Background Image Node drop-down list which is used to select a node which contains the image to be used for the background.
  2. If a path is configured to display a specific background image and then that background image node is unpublished, no background image should be displayed at that path. (Currently the unpublished background image will continue to be displayed.)

I'll work on a patch that addresses these points as well.

genjohnson’s picture

Status: Needs work » Needs review
FileSize
1.14 KB
861 bytes
124.82 KB

Adding on to the patch in #4, this patch will also prevent a background image from displaying on a path if the specific node selected is unpublished.

I played around with not including unpublished nodes in the selection list, but have decided to leave this behavior as-is until others provide input on this.

Only displaying published nodes in the list complicates the UI because then we must decide how to handle the case where a specific background image is selected for a path and then the node is unpublished (before another background image is selected for the path or the configuration for the path is removed). Another option may be easier and just as helpful is to add a column to the table to with the status (published/not published) of the selected background node. This would at least indicate why the selected image is no longer displayed.

Background Image management table with a column displaying that status of each selected node

mymaestro’s picture

Thanks @genjohnson this patch is working for me.
Agree a status column is more useful.