On updating media from 7.x-1.x to 7.x-2.x-dev I got this error:
NSERT INTO {role_permission} (rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 3 [:db_insert_placeholder_1] => edit any files [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3058 of D:\Projecten\Drupal7\test\modules\user\user.module).
It turns out that the file_entity module does not define the permission 'edit any files', though it does define "edit any $type files" for each file type. so I'm not sure this is an error in the media or file_entity module.
Comments
Comment #1
Ivan_Dagreat CreditAttribution: Ivan_Dagreat commentedSame issue for me. Any solution yet? Db update does not seem to complete because of the error.
Comment #2
Cruz3r CreditAttribution: Cruz3r commentedHi,
I'm experiencing the same problem.
However, I did find a workarround.
- install file_entity 2.x unstable
- update db
- install media 2.x unstable
- update db
- install file entity 2.x dev
- update db
- install media 2.x
- update db
No errors during database updating!
I believe the problem is caused by an 'inconsistency' between the file entity and media upgrade 'paths'.
As soon as file entity 2.x dev is installed, some fields from the media module have been updated.
When media then tries to update, it can't find those fields.
Comment #3
fietserwinIMO, if these modules are so interwoven, update hooks should check if, in this case, the permission still exists, before referring to it.
Comment #4
john_rosswvsu CreditAttribution: john_rosswvsu commentedA patch has been given here: https://drupal.org/node/2014297
Comment #5
Devin Carlson CreditAttribution: Devin Carlson commentedMarked #2014297: Some media permissions are missing. as a duplicate.
Comment #6
Devin Carlson CreditAttribution: Devin Carlson commentedA patch to implement
hook_update_dependencies()
to ensure thatmedia_update_7200()
runs beforefile_entity_7208()
.While declaring dependencies in this direction should generally be avoided, since this is only going to happen during an upgrade from Media 1.x to 2.x, it's not possible for File entity 2.x updates to have been run yet.
Comment #8
Devin Carlson CreditAttribution: Devin Carlson commentedOops, I was supposed to add this to the existing hook implementation before generating the patch. :P
Comment #9
Kristen PolPatch in #8 didn't help me but I followed instructions in #2 and got further... got to update 7208.
Now I get a different error... progress![Update]... forgot to update back to *dev*... #2 worked fine... got through all updates.
Thanks!
Comment #10
dtim CreditAttribution: dtim commentedFWIW, the upgrade instructions in #2 worked for me as well.
Comment #11
aaron CreditAttribution: aaron commented#8: media-update-7200-depends-on-file-entity-update-7208-2002890-8.patch queued for re-testing.
Comment #12
aaron CreditAttribution: aaron commentedThis looks good to go.
Comment #13
aaron CreditAttribution: aaron commentedCommitted to http://drupalcode.org/project/media.git/commit/a01d976
Comment #15
reubenavery CreditAttribution: reubenavery commentedRe-opening this.
Still hitting this error with the latest 2.x dev branch.
Comment #16
reubenavery CreditAttribution: reubenavery commentedHere's a patch.
Comment #18
reubenavery CreditAttribution: reubenavery commentedoops. here's a better patch.
Comment #19
reubenavery CreditAttribution: reubenavery commentedComment #21
Dave ReidComment #22
aschiwi CreditAttribution: aschiwi commentedSmall review from a non-coder: patch in #18 allowed me to run all updates without errors, thanks so much for that :)
Comment #23
wamilton CreditAttribution: wamilton commentedI was able to reproduce on a clean install with
file_entity-2.0-unstable7
media-1.x-dev
upgrading to media-2.x-dev
The patch fixes the problem.
The tests all pass locally, so the only thing holding this back is that testbot is failing to enable file_entity for our tests.
Comment #24
Dave ReidCommitted #18 to 7.x-2.x. http://drupalcode.org/project/media.git/commit/93e324a
Comment #25
holtzermann17 CreditAttribution: holtzermann17 commentedAfter checking out the most recent version of 7.x-2.x, I'm seeing a similar error at install time (not upgrade).
Comment #26
30equals CreditAttribution: 30equals commentedYup, having the same error on install as #25
Comment #27
jhedstromRe #25 I am not able to reproduce on a fresh site install.
Comment #28
checker CreditAttribution: checker commentedIs this issue still 7.x-2.0 beta blocker?
Comment #29
blacklabel_tom CreditAttribution: blacklabel_tom commentedIs this issue still 7.x-2.0 beta blocker?
Cheers
Tom
Comment #30
ParisLiakos CreditAttribution: ParisLiakos commentedlets open new issue, if there are any similar problems