ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

"The Image field is required."

June 22, 2011 3:30pm

Subscribe [4]
  • #1 / Jun 22, 2011 3:30pm

    HRC

    18 posts

    This question may be related to a resolved thread.

    or possibly

    This question may be related to a resolved thread.

    I am trying to post an entry and the image I add doesn’t have a thumbnail, says undefined, and the follows with the error “The Image field is required.” when I try to submit.

    On a side note, I also noticed that depending on how I upload the file it either uses 644 or 777 ... either way it should still work.

  • #2 / Jun 22, 2011 5:30pm

    Brandon Jones

    5500 posts

    Hi HRC,

    What version of ExpressionEngine are you using? File management has been re-vamped recently.

  • #3 / Jun 22, 2011 5:35pm

    HRC

    18 posts

    I just installed it. 2.1.3

  • #4 / Jun 23, 2011 5:10pm

    Kyle Cotter

    730 posts

    Hi HRC!

    EE 2.2 just launched yesterday, with a brand spankin new File Manager.

    It’s probably a good idea to update to the latest version.

    Thanks!

  • #5 / Jun 23, 2011 9:34pm

    HRC

    18 posts

    Ok, I updated to 2.2.0 and now I have a new issue to resolve before I can figure out if it fixed the original issue. The “File Manager” shows the following.

    You have no files uploaded to this directory. Please sync your directories.
    ${file_name}  ${file_size}  ${mime_type}  ${date}

    Show files as . {{if pagination_needed}}
    Showing ${pages_from} to ${pages_to} of ${pages_total} files.{{/if}}

    {{if pagination_needed}}{{html previous}}{{html dropdown}}{{html next}}{{/if}}

    The “sync your directories” goes to my site/%s which doesn’t work. I then tried to sync under the “File Upload Preferences” and I get the following

    Feature Images   3   img

     

    The file synchronization is complete.
    Directory   Number of Files Processed   Number of Errors   Errors Encountered
    ${directory_name}    ${files_processed}    ${error_count}   

      {{each errors}}
      {{html $value}}
      {{/each}}

    No errors

    Even though it says no errors and that its complete, It still isn’t synched and in my opinion looks like its broken

  • #6 / Jun 23, 2011 11:40pm

    narration

    773 posts

    HRC, I can say that synchronizing the File Manager does work properly on 2.2, having done it last night bringing up a site.

    That you are showing all these curly brackets and substitutors indicates you’re missing what is supposed to be evaluating them. Often this would be Javascript coming from the CP’s themes.

    I am thinking that maybe your themes are out of date. Did you remember to replace the earlier home/themes directory with the new full folder included in 2.2?

    As per instructions, you would then also merge back in any third_party or other folder extra themes you have from add-ons etc..

    I would try a fresh set anyway, as sometimes FTP fails if you ask it to over-write. First, rename the current themes folder to themes.old, so it’s available but out of the way.

    Hoping that may help, or a full EE files replacement in a similar rename and full upload manner. Or, it will be something else. Support will continue with you in that case.

    Regards,
    Clive

  • #7 / Jun 24, 2011 9:17am

    HRC

    18 posts

    Thanks, I had updated the themes but doing it again took care of that issue. So now we are getting closer. I get the following when I try to synch

    Thumbnail could not be created for the image. Please make sure the thumbnail directory is writable.

    I went in and double checked the directory and it was 644 for apache:user ... for giggles I even 777’ed and all the files in the directory with no joy

  • #8 / Jun 24, 2011 9:33am

    HRC

    18 posts

    Ok, now things are getting really odd. I changed all the permissions to 644 and it happily says it is synching. Problem is the files don’t show up when I try to add them via a publish.

    Also if I try to add new files I now get this vague error.

    “A problem was encountered while attempting to move the uploaded file to the final destination.”

  • #9 / Jun 24, 2011 10:12pm

    HRC

    18 posts

    To clarify I chmod the directory to 644 not the files, the files were already 644 before the synch says it completes

  • #10 / Jun 25, 2011 9:56pm

    HRC

    18 posts

    Is there no tech support on the weekends?

  • #11 / Jun 27, 2011 3:47pm

    Robin Sowell

    13255 posts

    Sorry HRC, we don’t currently have the weekends covered fully.  But let’s see if we can spot what’s going on.  This is a quick way to try and get an error- so make certain you’re set to show php errors to superadmins (Admin- System Prefs- Output and Debug).

    Now- we’re going to break your uploads, so don’t panic.  FTP in and open up system/codeigniter/system/libraries/Upload.php and look around line 294:

    /*
             * Move the file to the final destination
             * To deal with different server configurations
             * we'll attempt to use copy() first.  If that fails
             * we'll use move_uploaded_file().  One of the two should
             * reliably work in most environments
             */
            if ( ! @copy($this->file_temp, $this->upload_path.$this->file_name))
            {
                if ( ! @move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name))
                {
                    $this->set_error('upload_destination_error');
                    return FALSE;
                }
            }

    That’s where the error is coming from- for some reason the system is unable to move your final thumbnails over.  And we suppress errors.  So- let’s unsuppressed and exit.

    Edit the code to look like:

    if ( ! copy($this->file_temp, $this->upload_path.$this->file_name))
            {
                if ( ! move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name))
                {
                    exit('move failed');
    
                                    $this->set_error('upload_destination_error');
                    return FALSE;
                }
            }

    Now- save that and go to the file manager (Content- File Manager) and just try to upload some file via the upload button there.  It should come back with an error.  Assuming it does- can you paste the error here?  Obscure file paths as needed for security.

  • #12 / Jun 30, 2011 3:59pm

    HRC

    18 posts

    Thanks, I will try this later tonight

  • #13 / Jun 30, 2011 4:09pm

    Robin Sowell

    13255 posts

    Sounds good- let us know how it goes.  I suspect it will point to a server config issue.  At the least, it should narrow things down.

  • #14 / Jun 30, 2011 7:40pm

    HRC

    18 posts

    It had to do with GD and resizing. I just added GD and it works fine now. Thanks.

  • #15 / Jun 30, 2011 11:51pm

    Lisa Wess

    20502 posts

    Thanks for the update HRC - glad you got it working!

    If anything else comes up, please start a new thread and we’ll be happy to help.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases