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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ivan_Dagreat’s picture

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

Cruz3r’s picture

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.

fietserwin’s picture

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

john_rosswvsu’s picture

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

Devin Carlson’s picture

Priority: Normal » Major
Issue tags: +7.x-2.0 alpha blocker
Devin Carlson’s picture

Assigned: Unassigned » Devin Carlson
Status: Active » Needs review
FileSize
651 bytes

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
Devin Carlson’s picture

Status: Needs work » Needs review
FileSize
731 bytes

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

Kristen Pol’s picture

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!

dtim’s picture

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

aaron’s picture

aaron’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to go.

aaron’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

reubenavery’s picture

Status: Closed (fixed) » Active

Re-opening this.

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

reubenavery’s picture

Status: Active » Needs review
FileSize
730 bytes

Here's a patch.

Status: Needs review » Needs work
reubenavery’s picture

oops. here's a better patch.

reubenavery’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Dave Reid’s picture

aschiwi’s picture

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

wamilton’s picture

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.

Dave Reid’s picture

Status: Reviewed & tested by the community » Fixed
holtzermann17’s picture

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
30equals’s picture

Yup, having the same error on install as #25

jhedstrom’s picture

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

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

checker’s picture

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

blacklabel_tom’s picture

Issue summary: View changes

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

Cheers

Tom

ParisLiakos’s picture

Status: Postponed (maintainer needs more info) » Fixed
Issue tags: -7.x-2.0 beta blocker

lets open new issue, if there are any similar problems

Status: Fixed » Closed (fixed)

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