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.

Files: 
CommentFileSizeAuthor
#18 media-update-7200-depends-on-file-entity-update-7208-2002890-18.patch602 bytesreubenavery
FAILED: [[SimpleTest]]: [MySQL] 73 pass(es), 17 fail(s), and 13 exception(s).
[ View ]
#16 media-update-7200-depends-on-file-entity-update-7208-2002890-16.patch730 bytesreubenavery
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch media-update-7200-depends-on-file-entity-update-7208-2002890-16.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#8 media-update-7200-depends-on-file-entity-update-7208-2002890-8.patch731 bytesDevin Carlson
PASSED: [[SimpleTest]]: [MySQL] 92 pass(es).
[ View ]
#6 media-update-7200-depends-on-file-entity-update-7208-2002890-6.patch651 bytesDevin Carlson
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in sites/default/modules/media/media.install.
[ View ]

Comments

Same issue for me. Any solution yet? Db update does not seem to complete because of the error.

Hi,

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.

IMO, if these modules are so interwoven, update hooks should check if, in this case, the permission still exists, before referring to it.

A patch has been given here: https://drupal.org/node/2014297

Priority:Normal» Major
Issue tags:+7.x-2.0 alpha blocker

Assigned:Unassigned» Devin Carlson
Status:Active» Needs review
StatusFileSize
new651 bytes
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in sites/default/modules/media/media.install.
[ View ]

A patch to implement hook_update_dependencies() to ensure that media_update_7200() runs before file_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.

Status:Needs review» Needs work

Status:Needs work» Needs review
StatusFileSize
new731 bytes
PASSED: [[SimpleTest]]: [MySQL] 92 pass(es).
[ View ]

Oops, I was supposed to add this to the existing hook implementation before generating the patch. :P

Patch 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!

FWIW, the upgrade instructions in #2 worked for me as well.

Status:Needs review» Reviewed & tested by the community

This looks good to go.

Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status:Closed (fixed)» Active

Re-opening this.

Still hitting this error with the latest 2.x dev branch.

Status:Active» Needs review
StatusFileSize
new730 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch media-update-7200-depends-on-file-entity-update-7208-2002890-16.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Here's a patch.

Status:Needs review» Needs work

StatusFileSize
new602 bytes
FAILED: [[SimpleTest]]: [MySQL] 73 pass(es), 17 fail(s), and 13 exception(s).
[ View ]

oops. here's a better patch.

Status:Needs work» Needs review

Status:Needs review» Needs work

Small review from a non-coder: patch in #18 allowed me to run all updates without errors, thanks so much for that :)

Assigned:Devin Carlson» Unassigned
Status:Needs work» Reviewed & tested by the community

I 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.

Status:Reviewed & tested by the community» Fixed

Status:Fixed» Needs work

After checking out the most recent version of 7.x-2.x, I'm seeing a similar error at install time (not upgrade).

WD php: PDOException: SQLSTATE[23000]: Integrity constraint   violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array
(
    [:db_insert_placeholder_0] => 1
    [:db_insert_placeholder_1] => view media
    [:db_insert_placeholder_2] =>
)
in user_role_grant_permissions() (line 3058 of
/srv/www/decipher-storyscope/public_html/decipher/aug21/modules/user/user.module

Yup, having the same error on install as #25

Status:Needs work» Postponed (maintainer needs more info)

Re #25 I am not able to reproduce on a fresh site install.

Is this issue still 7.x-2.0 beta blocker?

Issue summary:View changes

Is this issue still 7.x-2.0 beta blocker?

Cheers

Tom