On a setup where I have a "slideshow creator" CCK field on a content-type, when I enter a list of images in the URL field, but leave the directory field, it creates a slideshow with all the files of the site.

The code responsible for this seems to be in theme_slideshow_creator_formatter_default()

  // Check it there is images on the slideshow: it can be
  //   - direct list of images
  //   - local directory where several images are
  if (!empty($ssc['#url']) or !empty($ssc['#dir'])) {
    if ($urls = split("\n", $ssc['#url'])) {   
      while (list($index, $url) = each($urls)) {
        $urls[$index] = 'img=|' . $url;
      }
    }
    if ($dirs = split("\n", $ssc['#dir'])) {   
      while (list($index, $url) = each($dirs)) {
        $dirs[$index] = 'dir=|' . $url;
      }
    }
[...]

In the above code, split("\n", $ssc['#dir']) will always return an array with an empty element, which then becomes "dir=|", who in turn fetches all the files in files/*

See attached patch (tested on the git master branch for 6.x).

CommentFileSizeAuthor
slideshow_creator.patch1.47 KBbgm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rhouse’s picture

Thanks Bgm, I'll test this out. Also, I have discovered that this feature doesn't work in the D7 version. I have created an issue #1268962: "CCK field" feature doesn't work in D7; Has been removed. to discuss this. You might want to have a say there.

rhouse’s picture

Status: Active » Fixed

Hi Bgm, I have uploaded your fix to git for inclusion in the next release, many thanks for solving that problem.

Status: Fixed » Closed (fixed)

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