-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Upload Field: File Paths #1719
Comments
Yep, this is annoying. |
In the current setup:
Correct behaviour in my eyes:
|
Yeah, this doesn't make a lot of sense. We can always derive the path from the field setting. The only time this may be annoying is if you're querying entries out of context of a Field, in which case you'd have to do an additional lookup to find the setting (think XMLImporter). Minor though, and could be solved. I wonder what we be involved in updating this. Out loud:
Doesn't seem too drastic. |
It's not, and it's a good idea. Worries would include breaking other fields that extend the default Fiel Upload field. Can those be checked before this is committed? |
The Unique Upload Field extension only deals with the filename, so I don't expect any problems here. |
I use a lot of @vlad-ghita's extension, mostly image_upload and multilingual_image_upload and I do not see anything getting broken. As long as the DS outputs the same values, it should be safe. The only possible broken extension would be @andrewminton's enhanced_upload_field, since we did use the data duplicated in order to have a custom sub-folder for each files. This is making me think that maybe duplication IS a GOOD thing... I would hate to change the folder on a field and loose all my precious data that is already there... So I think we should:
|
I had a look at the Enhance Upload Field and it looks like it uses |
Great! |
Woop! tidy darts. |
I've got this working locally, just curious how you'd like the migration to happen:
|
Personally, I'd prefer option 1 because it is straight forward and is not leaving me with two storage systems. |
I agree, although it is more work in the migration file, it has a better benefit in the long run. |
No worries, it's actually a lot simpler to do it in the migration than make the field tolerant :) The downside is that fields that extend the upload field will not be catered for as they won't be in |
Either that (which feels a bit strange) or inform the developers to use similar migration code in new versions of their extension. The updater could then say "If you are using upload field extensions, you must switch to compatible versions of these extensions." Not sure though which solution I prefer, to be honest. |
Me neither. I think the best way to do this would be with a wizard that guides the user through the steps... |
Very un Symphony like 👎
We can definitely do this now we have the pre/post migration notes. God I love the installer in 2.3! |
The core shouldn't interfere with extensions: running updates for extensions is an extension's task not a core one. |
Looks ok to me. |
@brendo I need a little help with this change. With |
I think here isn't the place to question about that. I'll post this in the forum, as an issue related to the extension https://github.com/klaftertief/imagecropper (but also to the S2.3.3) Searching about one hour for documentation, no success. |
Here I am again, bring some important considerations about the path being saved with "/workspace". Is this intentional? Every image with JIT will break with this... Plese check this carefully. About the questions above, already solved (http://www.getsymphony.com/discuss/thread/100199/). |
I've never had a broken image with JIT when using Fiel Upload fields of any kind.
|
Yep, that's I'm talking. The "/workspace" are saving in database and returning in XML (@path) in Integration branch. |
Here an example of what I'm saying: <imagem size="1.18 MB" path="/workspace/uploads/destaques" type="image/jpeg">
<filename>tostao1-517fdeb762b4f.jpg</filename>
<meta creation="2013-04-30T12:09:43-03:00" width="1418" height="957" />
</imagem> |
Ah, I see what you mean now. This will need fixing. |
Fixed, thanks! |
…gression from previous version. RE: #1719
Thanks Brendan, working smooth now! |
The migration for this change doesn't work when updating a Symphony install 03 May 2013 08:24 > Notice: Updater - Migration to 2.3.2 was successful
Could not complete upgrading. MySQL returned: 1146: MySQL Error (1146): Table 'test.default_entries_data_10' doesn't exist in query: UPDATE default_entries_data_10 SET file = substring_index(file, '/', -1)
03 May 2013 08:24 > Notice: Updater - Migration to 2.3.3beta2 was unsuccessful |
Sorry, I was looking at the wrong table: there are upload fields in the install and the issue still exists. |
Okay, here we go: The migration file hardcodes the |
Fixed! Thanks, |
Using the latest code in
It doesn't matter if the upload field has content or not. |
|
It seems like Publish Filtering is the source of the problem. Still, the issue didn't exist before updating to the latest beta. |
This commit causes the issue: e631d85 |
@michael-e , are you sure?
I check here, and filepath is saved on database. Edit: The Unique Upload Field extend Upload Field, right? So maybe this is only a migration issue. When fetch |
As the field won't affect file paths from now on, then it doesn't need to run any updates. Yes there will be a problem with paths in existing tables, but the core won't and shouldn't upgrade extension tables. You'll just have to do a manual change I'm afraid. Bit of a pain, and I've done it myself. |
Understood @designermonkey , thanks for the explanation. I inject an update in the migration file to cover this ground and it is working now. |
Yeah, that's what I did too :) Glad you got it sorted. |
I admit that I haven' added the update logic to the extension yet. I should do and release a new version. |
@michael-e that's a very useful extension, would bee good if the |
This has been proposed several times. I am not sure, however, if it is still on the list for Symphony 2. I don't think so, because we agreed on concentrating on bug fixes and "polishing". My implementation (simply using a unique hash) has been a matter of discussion a while back. Some people said that they would prefer adding a "counter" to filenames that already exist (like the Unique Input Field can do it), because the hash part of the filename is ugly in their eyes. I don't like complicated solutions, however, and a unique hash (based on microtime) is the strongest solution and even allows moving files between folders without issues. So I wanted to keep the extension logic as it is. |
Yeah, agreed. I don't think the user overriding by default her files is a good idea. I'm using Unique Upload field in all projects. |
Symphony's upload field stores the file path in
sym_field_upload
but also adds it to the actual entry insym_entries_*
. Why?If I moved folders on the server an change the path in the section editor, all existing entries will get invalid, because they still store the original path. Why doesn't the field just store the file name in the entries table and combines this on load with the defined path.
The text was updated successfully, but these errors were encountered: