We have an problem with a SafeCracker file field in a SAEF form. We have a MSM setup with EE 2.1.4. The channel where we want to upload the photo is on site_id 1. The form is on site_id 2. We have double checked all the file upload settings and paths and they are ok, rights too. But we get the following error when we open the form.
A PHP Error was encountered
Severity: Warning
Message: preg_match() expects parameter 2 to be string, array given
Filename: safecracker_file/ft.safecracker_file.php
Line Number: 75After looking at the debug results we think that the file field is ignoring the site_id in the form and because of that the correct path is not found. Does somebody know how we can fix this.
This is the test form we use, nothing special.
{exp:safecracker
name="add_photoset_form"
id="add_photoset_form"
class="form"
site="pmh"
channel="section_default_photosets"
return="pms/index"
safecracker_head="yes"
include_jquery="no"
date_picker="no"
}
<label for="title">Entry Title</label>
<input type="text" name="title" id="title" value="{title}" maxlength="75" class="field">
<label for="url_title">URL Title</label>
<input type="text" name="url_title" id="url_title" value="{url_title}" maxlength="75" class="field" />
<label for="entry_date">Entry Date</label>
<input type="text" name="entry_date" id="entry_date" value="{entry_date}" class="field" />
<label for="status">Status</label>
<select name="status" id="status" class="select">
{statuses}
<option value="{status}"{selected}>{status}</option>
{/statuses}
</select>
<h5>Photos</h5>
<p>{field:def_photos}</p>
<p><br />
<input type="submit" name="submit" value="Submit" /><br />
{/exp:safecracker}