I installed Shadowbox (the Drupal module and the separate download - Status Report page says 'Installed correctly'), but when I try to edit the settings, it keeps saying:
You must enter a valid path to an SWF Flash Player in the form flvplayer.swf.

I've checked and re-checked the URL (which is right), and even un-installed and re-installed the module, but to no avail.
Please tell me what I'm doing wrong.

CommentFileSizeAuthor
#5 shadowbox-355014-4.patch663 bytesAnonymous (not verified)

Comments

psynaptic’s picture

Have you made sure the file exists at that path?

Anonymous’s picture

Yes (one of the first things I did). I even re-copied that file in case something went wrong the first time... Still no luck.

psynaptic’s picture

Ive had problems with that before. Something to do with the validation of the file. Check for a file_exists() function call and dump some stuff to see if you can find what it is. Sorry I don't have time to look into it myself right now and you are in the perfect situation to find a bug since it's happening to you i.e. you have the environment set up where the problem is occurring.

Anonymous’s picture

Status: Active » Needs review

I found it! It wasn't quite the file_exists() function, but the one right above it:

if (!preg_match('!^([a-z0-9_\-\.]+/)*[a-z0-9_\-]+\.swf$!i', $flv_player)) {
  form_set_error('shadowbox_flv_player', t('You must enter a valid path to an SWF Flash Player in the form flvplayer.swf.'));
}

All it was missing was a '\.' in the regular expression to allow URLs like 'sites/my.site.com/modules/shadowbox/etc' (had to teach myself regular expressions to figure this out ;)

I created a patch of shadowbox.module in the 6.x-2.x-dev (2008-Nov-14) version and attached it.

Anonymous’s picture

StatusFileSize
new663 bytes

Thought I attached it...

psynaptic’s picture

Well done!

I love it when people teach themselves about the problem, it really shows true Drupal spirit.

Thanks for the patch. I'll update this ASAP in the dev version. Just got to finish this project first..

psynaptic’s picture

Status: Needs review » Fixed

Thanks BWPanda, this has been committed to the DRUPAL-5--2 and DRUPAL-6--2 branches.

http://drupal.org/cvs?commit=164516
http://drupal.org/cvs?commit=164517

Anonymous’s picture

Glad to help!

Status: Fixed » Closed (fixed)
Issue tags: -flvplayer

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