Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#5 | interdiff-2452527-4-5.txt | 861 bytes | genjohnson |
#5 | bg_image-unpublished_nodes-2452527-5.patch | 1.14 KB | genjohnson |
#4 | bg_image-unpublished_nodes-2452527-4.patch | 432 bytes | genjohnson |
Comments
Comment #1
GuyManDude CreditAttribution: GuyManDude commentedI 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
Comment #2
GuyManDude CreditAttribution: GuyManDude commentedI'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.
Comment #3
GuyManDude CreditAttribution: GuyManDude commentedThe 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?
Comment #4
genjohnson CreditAttribution: genjohnson at The University of Iowa commentedI'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:
I'll work on a patch that addresses these points as well.
Comment #5
genjohnson CreditAttribution: genjohnson at The University of Iowa commentedAdding 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.
Comment #6
mymaestro CreditAttribution: mymaestro as a volunteer and commentedThanks @genjohnson this patch is working for me.
Agree a status column is more useful.