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.
According to our own list of reserved words, FILE is a reserved word and we shouldn't be using it.
This is used in two places:
- the new {file} table
- the menu_router.file column
Comment | File | Size | Author |
---|---|---|---|
#21 | 741578-rename_file_table-d7.patch | 18.86 KB | andypost |
#20 | 741578-rename_file_table-d7.patch | 18.85 KB | andypost |
#19 | rename_file.patch | 17.81 KB | bcn |
#16 | rename_file.patch | 18.1 KB | Berdir |
#11 | menu_router.3.patch | 3.6 KB | nikgregory |
Comments
Comment #1
pwolanin CreditAttribution: pwolanin commentedThe menu router column is the same in Drupal 6, so wow - we suck.
Comment #2
nikgregory CreditAttribution: nikgregory commentedHere is a patch that addresses menu_router.file and the associated update
Comment #3
pwolanin CreditAttribution: pwolanin commentedComment #5
pwolanin CreditAttribution: pwolanin commentedLooks like a bogus fail (Poll module).
Comment #6
tyabut CreditAttribution: tyabut commented#2: menu_router.patch queued for re-testing.
Comment #8
nikgregory CreditAttribution: nikgregory commentedhere is the menu_router patch with less crufty goodness
Comment #9
nikgregory CreditAttribution: nikgregory commentedA start on the file table. file-> fileinfo.
This needs work, I cannot get the install to complete successfully after applying the patch, I get past the
site configuration screen and end up on an error screen with the following
Warning: array_keys(): The first argument should be an array in drupal_schema_fields_sql() (line 5679 of /Users/nik/sandbox/d7/drupal/includes/common.inc).
Recoverable fatal error: Argument 2 passed to SelectQuery::fields() must be an array, null given, called in /Users/nik/sandbox/d7/drupal/includes/entity.inc on line 210 and defined in SelectQuery->fields() (line 1124 of /Users/nik/sandbox/d7/drupal/includes/database/select.inc)
Comment #10
pwolanin CreditAttribution: pwolanin commentedComment #11
nikgregory CreditAttribution: nikgregory commentedfixed the failing poll test (i believe) form.inc makes an assumption on menu_router['file']
Comment #13
nikgregory CreditAttribution: nikgregory commented#11: menu_router.3.patch queued for re-testing.
Comment #15
sunRegarding {file}, a more consistent name would be {file_managed}. See http://api.drupal.org/api/search/7/file_managed
Unintended change, I guess.
Powered by Dreditor.
Comment #16
BerdirOk, removed the case change and renamed file to file_managed. Installing does work, lets see what the testbot says.
What I'm not certain about is we should rename the entity type to filed_managed or just rename the base table. I just renamed the base table now, but renaming the entity would probably be better.
Comment #17
sunWrong indentation + missing trailing comma in multi-line array here.
The key 'description' can be removed from this update.
Interesting. Only seeing changes for 'description' keys in this patch probably means that we are missing some proper 'foreign keys' definitions for these tables (probably better to do in a separate issue, bonus points for creating it ;).
139 critical left. Go review some!
Comment #18
catchComment #19
bcn CreditAttribution: bcn commentedRe-roll to get this to apply cleanly to head...
Still doesn't address sun's second part of #17:
Comment #20
andypostSame patch with fixed system_update_7052()
Description is useless when changing field
{users}.picture should be different issue, because {file}.uid already have foreign key to {users}.uid
So we could get circular reference
Comment #21
andypostFixed doc-block to conform standard.
EDIT: should we allow FieldAPI to create field with name 'file' ?
Comment #22
sunThanks! Looks good to go.
Comment #23
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD.
Comment #24
rfayOn all (I think) of my sites the hook_update_N() has failed to create the file_managed table. I haven't caught the errors exactly, but it leaves the site in a half-functional state, with PDO errors on every page load.
The resultant error is predictably (here to help search engine):
A workaround that seems to get a site sane again is:
Comment #25
andypost@rfay do you upgrading from D6? if not so this hook should not be run. I've tested this on clean install (today's HEAD) and it works without any warnings
Comment #26
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis falls into the "we don't support 7.x to 7.x updates until the first beta version" category. Back to fixed.
Comment #27
rfay@damien, #26: that's fine... But then why implement hook_update_N() with an update that doesn't work? Or doesn't work most of the time?
@andypost, #25: No, of course not, D6 upgrades are still impossible (or they were last week). This is a simple update.php on an existing D7 site after updating the code.
Comment #28
catch@rfay, there's no upgrade for file->file_managed that would run on HEAD - the patch only changes the schema and updates an older D7 update to use the correct name. The new update is for the {menu_router}.file column, which worked fine on my HEAD install.