A new extension, “Field: Uploaded Files Select Box” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

So here you have it, a bad bad bug:


[EDIT]: I posted a second bug. I am the bugman. Don’t ever give me your software.


I was in two-minds as to whether to release this to the public. I’m using it on one project for myself, but I don’t really have much intention to maintain it… it was just to fulfil a quick requirement. But I’ll patch these up for now, thanks ;-)

Well, now it’s public. It is indeed useful to me, and it doesn’t look too complicated, so I’ll probably take the risk and use it for my projects (even if you don’t maintain it actively).

Issues 1 and 2 closed.

Uploaded Files Select Box updated to version 1.1.1 on 30th of August 2010

Hi all, I installed the extension, created a folder under /workspace/media/press_kits (777), dropped some files in it and set it as the search path for Uploaded Files Select Box field in one of my sections. So far so good, but whenever I try to create a new entry, the field’s dropdown menu is greyed out.

I am running Sym 2.1.1

Any clues?

Screen shot 2010-09-09 at 19.32.43.png

Experiencing the same problem as tmslnz

To debug this take a look at the displayPublishPanel function in the field file in the extension. It looks like this like isn’t getting the list of files:

$states = General::listStructure(DOCROOT . $this->get('destination'), null, false, 'asc', DOCROOT);

Thanks Nick, I was looking at both the listStructure method definition and your displayPublishPaneland I couldn’t spot any obvious problems, but my OOphp is not really that good.

^^^ BOOO!

Hi… I gave up too quickly. In fact I think I found the culprit.

line 123: if (is_null($states['filelist']) || empty($status['filelist'])) $states['filelist'] = array();

The empty($status['filelist']) condition seems to always return true, resulting in an empty $states['filelist'] array.

Either commenting the whole line or getting rid of the second condition makes it work.

EDIT: Should I declare it a typo? I imagine it should be $states instead of $status.

Aha! Yes that looks like a typo to me. Ooops. Changing status to states resolved the issue?

Yes it solves it.

Found another issue, see this XML output:

    <section id="12" handle="illustrations">Illustrations</section>
    <entry id="165">
    <entry id="158">
        <file path="/media/illustration">
            <item size="462 KB">wholepage-left.jpg</item>

The <entry id="165"> should have various <file> children, but it doesn’t. At least this is what I expected as I ticked the “Allow multiple” checkbox in the field, and selected a bunch of files to see what it would do.

Bug or simply missing feature?

@Nick, the typo error (see above) is still alive. I can confirm that correcting the typo solves the issue.

Uploaded Files Select Box updated to version 1.1.2 on 7th of February 2011

Hi, I'm getting this error in Symphony 2.2 (v1.1.2 for the extension):

preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash
/home/bdcreati/domains/ line 874

869                 or in_array($file, $exclude)
870                 or in_array("$dir/$file", $exclude)
871             ) continue;
873             if(!is_null($filter)) {
874                 if(!preg_match($filter, $file)) continue;
875             }
877             $files[] = str_replace($strip_root, '', $dir) ."/$file/";

Any ideas how to solve this?

It doesn’t list any directories except “/workspace” itself (2.2+). Changing line 84 (“field.uploadselectbox.php”)

$directories = General::listDirStructure(WORKSPACE, true, 'asc', DOCROOT, $ignore);


$directories = General::listDirStructure(WORKSPACE, null, 'asc', DOCROOT, $ignore);

lets it print those out that shouldn’t be ignored.

No idea if this is possible or totally stupid. Currently working on adding some custom fields through an extensions on the Authors page. In order to be able to generate a signature. One of the requirements is an image. Would it be possible to make use of the uploadselectbox interface through other extensions? Not too convinced I can but asking anyway.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details