Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
file_save_upload() is in file.inc, but we moved the file entity to file.module, so this function should be there too.
Similarly, there's a lot of token-related code in system_token_info() and system_tokens(), probably test coverage too. That also needs to move to file.module.
Comment | File | Size | Author |
---|---|---|---|
#14 | moving-file-code-2045189-14.patch | 30.07 KB | jlindsey15 |
#12 | moving-file-code-2045189-12.patch | 30.06 KB | jlindsey15 |
#8 | moving-file-code-2045189-8.patch | 30.06 KB | jlindsey15 |
#4 | moving-file-code-2045189-4.patch | 29.69 KB | jlindsey15 |
#5 | moving-file-code-2045189-5.patch | 29.96 KB | jlindsey15 |
Comments
Comment #1
jlindsey15 CreditAttribution: jlindsey15 commentedI'll tackle this.
Comment #2
jlindsey15 CreditAttribution: jlindsey15 commentedHere goes...
Comment #3
BerdirThanks for working on this!
Not sure if this needs to be moved, doesn't seem to depend on file entity?
This is a hook, so the function name prefix needs to change to file.
Also, don't move the whole function, just the part that's about files. date/site needs to stay in system_token_info()/system.module.
Comment #4
jlindsey15 CreditAttribution: jlindsey15 commentedThanks for the feedback - I think this should work now (or at least it's a lot better than the last one :)
EDIT: see the next comment for the version with proper documentation.
Comment #5
jlindsey15 CreditAttribution: jlindsey15 commentedI forgot to change the comments to reflect the changes in that last patch, but it's good now.
Comment #6
jhodgdonNot just documentation.
Comment #7
BerdirClose :)
This is missing a return of the types and tokens.
Comment #8
jlindsey15 CreditAttribution: jlindsey15 commentedOkay another try!
Comment #9
jlindsey15 CreditAttribution: jlindsey15 commentedI'm without access to git for the next week and a half for not-worth-explaining reasons - that last patch was an attempt to manually fix the patch file, which not surprisingly failed. I'll finish it up when I get back, unless someone else does first.
Comment #11
BerdirUnassigning then, thanks for working on it, let's see if someone picks it up.
Comment #12
jlindsey15 CreditAttribution: jlindsey15 commentedManaged to finish it up anyway! (hopefully...)
Comment #13
BerdirIndentation here is a bit off, missed that before.
Comment #14
jlindsey15 CreditAttribution: jlindsey15 commentedIndentation issue fixed:
Comment #15
jlindsey15 CreditAttribution: jlindsey15 commentedComment #16
BerdirGreat, looks good to me.
Comment #17
catchSystem module calls file_save_upload() unconditionally with the patch applied - that'll be a fatal error with the patch applied and file module disabled no?
Comment #18
BerdirThat code is wrapped in a module exists check. It would already fail right now (due to the missing entity type), that's why we added the module exists there when originally moving the entity type code from system.module/file.inc to file.module. Quite sure that we have tests for this that explode without that module exists check.
So I think we're fine. Yes, maybe that should be a form alter, but we discussed that back then and for some reason, didn't do that.
Comment #19
catchArghh missed the module exists check.
That's ugly but it's not introduced here, so committed/pushed to 8.x.
Comment #20
jlindsey15 CreditAttribution: jlindsey15 commentedI'm just curious, since this is the first patch I've made to be committed - is there somewhere on your account that tells you if an issue you worked on got committed, or lists ones that did? The "Your Commits" tab seemed promising but didn't show anything. I don't really care much if there isn't, and apologies if this is a stupid/out-of-place question, but if I was missing something I wanted to know!
Comment #21
tstoeckler@jlindsey15: Congrats on your first core commit! Sadly, there is currently no such listing in core.
Comment #22
BerdirCongrats! There is no official list, the reason is that the profile only shows commits you commit yourself and those where the committer used --author, which is not used for core as it only works for a single author.
There are inofficial lists, which parse the git commit messages, but they might contain errors. See http://ericduran.github.io/drupalcores/, for example.