Introduced in #2311957: Add weights to linkit profiles with commit:
http://cgit.drupalcode.org/linkit/commit/?h=7.x-3.x&id=542ad173c232b08d8...
Steps to reproduce:
- Install 7.x-2.7
- Have at least one Linkit profile.
- Update to latest 7.x-3.x-dev
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'weight' in 'field list'
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | linkit-2842804.patch | 2.55 KB | sthomen |
| #11 | fix_update_error-2842804-11.patch | 2.1 KB | barami |
| #10 | fix_update_error-2842804-10.patch | 1.07 KB | barami |
| #6 | error_in-2842804-6.patch | 958 bytes | anon |
Comments
Comment #2
ciss commentedComment #3
ciss commentedComment #4
ciss commentedFrom what I'm glancing the best course of action would probably be to call 7305 at the beginning of 7303 and add a column check to 7305. Otherwise a lot of logic from linkit_profile_load_all() might have to be replicated.
Comment #5
miroslavbanov commentedFixing steps to reproduce.
Problem is that ctools_export_crud_load loads the schema and thinks there is weight column. Not sure what should be done about it. With all these back-and-forth schema changes, it may be safest to not rely on ctools functions, and to use simple sql queries in the update function.
Comment #6
anonThis patchs does two things.
Comment #7
ciss commentedInstallations at schema version 7300 will still have trouble passing
73027303. If you're not worried about those then the patch should be good to go.Comment #8
miroslavbanov commentedSee my notes in #5. Ctools crud functions call drupal_get_schema, so they shouldn't be used in update hooks. See: https://www.drupal.org/node/150220.
You fix your update now, it breaks the next time you change the schema.
Comment #9
anonComment #10
barami commentedThis patch copied from #5. And prevent side effect when change schema function in the future.
Comment #11
barami commentedThis patch also modify linkit_update_7304 function to prevent side effect when schema function changed
(eg. when profile_type or admin_description field removed)
Comment #12
elioshHi,
I was coming from 2.7 and patch in #11 doesn't work, with the same message as always:
Comment #13
featherbelly@eliosh you'll probably need to run ALL of the updates again as the patch affects linkit_update_7300.
Comment #14
eliosh@fatherbelly I've changed the system table and set schema_version to 7227.
Run drush updb and...
Comment #15
skylord commented#11 worked fine for upgrade from 2.7 to 3.6. Have disabled module, replaced files, applied patch and run "drush updb".
Comment #16
danrodPatch # 11 is not working for me, can anyone provide the steps on how to apply the patch and run the updates, please?
Comment #17
sthomen commentedThis patch might work better. #11 requires that you have not already run 7300. Instead of removing the removal of the 'weight' field I just add it back in 7303. This patch (like #11) also removes the risky use of drupal_get_schema_unprocessed() (it will give you the _current_ schema, but how do you know it represents the expected schema at the given update?).
Comment #18
optasy commentedPatch #17 did the work for me, thanks for that @sthomen !
Comment #20
mark_fullmerThanks for the input, everyone! I've committed the patch from #17 to the 7.x-3.x branch.