Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.2.2 Beta 2: Upload Field Failure #717

Closed
nilshoerrmann opened this issue Jul 12, 2011 · 11 comments
Closed

2.2.2 Beta 2: Upload Field Failure #717

nilshoerrmann opened this issue Jul 12, 2011 · 11 comments
Assignees
Milestone

Comments

@nilshoerrmann
Copy link
Contributor

I just update an install from 2.2.2 Beta 1 to Beta 2. The install was unused before (no pages and section). After updating I created a first section which contains an upload field. Saving an entry with a file attached won't save the file and won't throw an error.

Permissions seem not to be a problem (even 777 won't work). This is what Symphony stores in the database:

id entry_id file size mimetype meta
3 1 NULL NULL NULL NULL
@michael-e
Copy link
Member

I can not replicate this with the current integration code, freshly installed. File upload works fine.

Might it be an update problem?

@nilshoerrmann
Copy link
Contributor Author

Not sure – the updater definitely run. Were there any changes related to the upload field I'm not aware of?

@brendo
Copy link
Member

brendo commented Jul 12, 2011

Yeah working ok here too on a update from Beta 1 (well it's my progressive integration copy, so much the same). This is the history of changes, with Symphony 2.2.1 released on April 26th and 2.2.2 Beta 1 released June 17th it leaves the top 3 commits if any bug has been introduced.

@nilshoerrmann
Copy link
Contributor Author

Okay, I did some experiments:

This problem seems not to be a result of the update but of the fact that I added the upload field after I first created an entry in my section. Everything works perfectly when I create new entries but I cannot attach files to the existing entries (which is only one in my case, so this is not a problem).

So this issue is fixed for me but still there seems to be happening something strange when you add an upload field at a later date to an existing section.

@michael-e
Copy link
Member

Again I can not confirm this on a fresh install. I had saved one first entry, then added the upload field to section. I was still able to upload to the first entry. So I still assume that the issue must have to do with the update.

@nilshoerrmann
Copy link
Contributor Author

But the section did not exist before the update. I created the section, added the first entry and then added the upload field.

@michael-e
Copy link
Member

This is very strange then. :-(

@nilshoerrmann
Copy link
Contributor Author

Indeed.

I'll close this issue as I cannot provide any helpful information beside the few given details and no one seems to be able to reproduce my issue.

@nilshoerrmann
Copy link
Contributor Author

Okay, my problem reappeared: if I don't attach an image while creating an entry, I cannot add it at a later date. I've started debugging the upload field. It seems like processRawFieldData() is always called with $simulate = true. The $data array seems to be fine though:

Array
(
    [name] => Test_Test.jpg
    [type] => image/jpeg
    [tmp_name] => /Applications/MAMP/tmp/php/phpa4WvFR
    [error] => 0
    [size] => 22961
)

The database stores this:

id entry_id file size mimetype meta
32 1 NULL NULL NULL NULL

Any hints where to search, what to debug?

@nilshoerrmann
Copy link
Contributor Author

Removing this line solves my issue. What's the reason for that line?

@nilshoerrmann
Copy link
Contributor Author

Okay, I found the problematic commit:

2df7104#L0R863

It says:

setDataFromPost should actually simulate data being saved, as Entry->commit will do a repeat call without simulation to save the data

This seems not to be true for the upload field which looses its data between the calls.

Steps to replicate this issue

  • Update to the latest integration code.
  • Create a section with an input and an optional upload field.
  • Create an entry and leave the upload field empty.
  • Edit the entry, attach a file and save.
  • The file will not be added.

Adding a file directly while creating a new entry just works fine. This problem is only related to entry editing.

@ghost ghost assigned brendo Jul 13, 2011
@brendo brendo closed this as completed in cfd2b5d Jul 17, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants