We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Channel entries with File Fields won't save

Developer Preview

DigitalDoctors's avatar
DigitalDoctors
76 posts
12 years ago
DigitalDoctors's avatar DigitalDoctors

EE Core Version: 2.7.0

I have a channel group where if I add a File Field then upload a pdf, it just reloads the channel entry page instead of saving. There are no error messages. Channel field is not updated in the database. Also, this seems to add random empty p tags to the RTE in the channel entry too.

The channel group has 2 fields - a RTE field and a File field with All file types allowed.

As soon as I delete the File field from the channel group, the channel entries page goes back to saving properly.

Cheers,

       
DigitalDoctors's avatar
DigitalDoctors
76 posts
12 years ago
DigitalDoctors's avatar DigitalDoctors

This appears to be a Core only problem - have reproduced on a fresh Core install with no modifications.

Steps to reproduce:

  1. Install core
  2. Create a folder for files to be uploaded to - I use /assets/downloads
  3. Create a channel
  4. Create a channel field group and put a File channel field in this group, then assign group to channel
  5. Go Publish an entry
  6. Upload file then try to submit channel entry.

The page just reloads the channel entry page instead of going to the confirmed page.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
12 years ago
Kevin Cupp's avatar Kevin Cupp

Thanks, DigitalDoctors. It seems the dev preview build was missing a couple commits, strange quirk with Git that we noticed with commits closely-grouped together in time. If you make these modifications, it should be fixed:

Open system/expressionengine/libraries/File_field.php, find this code on line 265:

$filename = '';

And REPLACE it with this:

$filename = $_POST[$field_name] = '';

Open system/expressionengine/libraries/api/Api_channel_entries.php, find this code on line 1006:

unset($data['field_id_'.$row['field_id'].'_hidden']);

And DELETE it.

Then add these two unsets below that “if ($this->autosave” statement above the existing unset so it looks like this:

}
 
unset($data['field_id_'.$row['field_id'].'_hidden_file']);
unset($data['field_id_'.$row['field_id'].'_hidden_dir']);
unset($data['field_id_'.$row['field_id'].'_directory']);
       
DigitalDoctors's avatar
DigitalDoctors
76 posts
12 years ago
DigitalDoctors's avatar DigitalDoctors

Thanks Kevin, that’s sorted it out perfectly.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.