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.
fresh copies of media and file-entity modules right from git.when enabling them i get this:
Notice: Undefined index: view media in user_role_grant_permissions() (line 3026 of /var/www/d7/modules/user/user.module).
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 3028 of /var/www/d7/modules/user/user.module).
If i go back to the modules page i see them as enabled.Field UI works as expected but cant add images to nodes,since after i click the select media button i get requested page not found.
Well it might have to do with the latest commits and you are already aware of this,i m still reporting this :)
Comment | File | Size | Author |
---|---|---|---|
#24 | media-n1290556-24.patch | 623 bytes | DamienMcKenna |
#13 | media-n1290556-13.patch | 661 bytes | DamienMcKenna |
#3 | change_permission_in_install-1290556-3.patch | 377 bytes | ParisLiakos |
Comments
Comment #1
ParisLiakos CreditAttribution: ParisLiakos commentedIts media that causes this.
I retried this time by enabling file entity first,everything worked.but when try to enable media i get this again
Comment #2
tsvenson CreditAttribution: tsvenson commentedConfirmed, happens for me too using latest git versions.
Comment #3
ParisLiakos CreditAttribution: ParisLiakos commentedIts cause this permission got renamed in file_entity when moved.
we have to change it in media's .install file too.
or maybe move the whole media_install in file_entity,since it should create this types,not media?
Comment #4
tsvenson CreditAttribution: tsvenson commentedPatch in #3 seems to do the trick, the Media module now installs.
However, on line 321 in the media.install, update 7008, there is another permission where second argument is 'view media'. Just wanted to highlight that to make sure it too doesn't need to be changed to 'view file'.
Comment #5
davidseth CreditAttribution: davidseth commentedJust tested as well, Patch in #3 works for me.
Comment #6
Dave ReidActually it should be file_entity that enables this permission by default, not media. We need to move this logic from media_install to file_entity_install().
Comment #7
ParisLiakos CreditAttribution: ParisLiakos commented@Dave Reid just the permission or the file types creation as well?
Comment #8
ParisLiakos CreditAttribution: ParisLiakos commentedThis is fixed now
Comment #9
emptyvoid CreditAttribution: emptyvoid commentedNot sure if I should create a new issue or just set the current on to "active".
Environment:
Linux Ubuntu 11
PHP 5.3.2
Mysql 5.0
Fresh build - Drush list
Upon attempting to enable the module I promptly get:
I suspect the media_schema() in the media.install is wrong and doesn't build the scheme on a clean install.
Comment #10
DamienMcKennaRunning into the exact same problem trying to do a fresh install with the latest 7.x-2.x-dev code on D7.8.
Comment #11
DamienMcKennaI grabbed the record from {batch} and this is what I see in the 'batch' field:
Comment #12
DamienMcKennaI hacked install_profile_modules() to find out what was going on, here's the list of modules & their weights before they get added to the batch:
Based on what I was seeing of the installer running, it looks like it does fail on Media and not on file_entity() as I was suspecting.
Comment #13
DamienMcKennaOk, here's the craziest thing... I changed media_install() to media_enable() and it works! No error!
Comment #14
DamienMcKennaOh, wait, I ran the installer again a few more times and it failed at exactly the same point. Oh noes.
Comment #15
DamienMcKennaCompletely skipping the media_install() function entirely by putting a return; on its first line causes it to work correctly. Go figure.
Comment #16
DamienMcKennaHaving spent ages trying to debug this..... the installation fails when module_enable() hits registry_update() before media_schema() and media_install() have executed. Aw crap.
Comment #17
tsvenson CreditAttribution: tsvenson commentedI just tried enabling the Media module, several times as well as the depreciated Media Field module using the latest available 2.x-dev, Oct 16th version, on the project page, together with the currently available 2.x-dev Oct 15th version, of File Entity. They got enabled without any problems, neither on screen or in the log.
To verify everything working I also changed the Article CT Image field to use the Media browser widget and then uploaded an image to a new content. Also worked perfectly and without any issues or log error.
This is on Drupal 7.8 with Views 3.0 RC1 and CTools 1.0 RC1 on my local Win 7 Acquia Dev Desktop 7.4.4. No other modules, just a fresh install to verify it works.
Thus, this problem might not be with the Media (or File Entity) module. As some of you have other modules installed, its likely some form of conflict.
Have you verified this is happening when you only enable the Media module as well?
Until we know for sure this is a bug in the Media module, I am downgrading it to Normal.
Comment #18
tsvenson CreditAttribution: tsvenson commentedI also did an update of one of my dev sites that included these updates:
file_entity module
media module
They too went through without any complaints or errors in the log.
Comment #19
DamienMcKennatsvenson: it seems you are correct, having an installation profile with only core + Media (and its dependencies) selected doesn't run into any problems, it all works. My assortment of 164 modules (total) - it fails at item ~64 when it tries to load Media. Back to MacGDBp..
Comment #20
tsvenson CreditAttribution: tsvenson commented@DamienMcKenna Oki, then we can at least rule something out. Below is a list of all the modules that was enabled when I did the update of the Media module as described in comment #18. Hope it can help you narrow down your list a bit at least.
Comment #21
DamienMcKennaFurther debugging.. the error occurs when media_type_get_types() is called. More debugging to follow..
Comment #22
DamienMcKennaThe media_type_get_types() function is called by media_file_type_info(), via CTools' _registry_update()... the battle continues.
Comment #23
DamienMcKennaSo it goes module_enable() -> registry_update() -> ctools_registry_files_alter() -> _ctools_registry_files_alter() -> (not sure exactly, too bored to fully test it) -> media_file_type_info() -> media_type_get_types() -> BOOM!
Comment #24
DamienMcKennaHere's a patch that changes media_tye_get_types() to return an empty array if an installation profile is running and the schema doesn't exist. I've tested this twice and it was able to continue on without any further problems, from Media.module at least ;-)
Please try this out on your own installation profiles and let me know how it works. FYI I'm using Drupal 7.8, Media 7.x-2.x-dev from 2011-10-13, File Entity 7.x-2.x-unstable2 and CTools 7.x-1.x-dev from 2011-09-17.
Comment #25
DamienMcKennaApologies for taking over this thread, I'm reverting the status and have opened a separate ticket for the new problem: #1311828: Installation fails with SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database.media_type' doesn't exist
Comment #27
drewkeller CreditAttribution: drewkeller commentedThe patch in #3 worked for me to get past the error with install, EXCEPT that I also had to change a few other places in that same function which still referred to 'media' instead of 'file' ('view media' and 'administer media' should be 'view file' and 'administer file'). I'm not a patching expert. Maybe the patch was written against an older version where it was slightly different or something. Mine is the one that has 2013-Jun-16 as the date on drupal's media module page.
Comment #28
rogman_lebnh CreditAttribution: rogman_lebnh commentedThis issue should not be closed. :-(
(Then again, that's what I get for using 2.0-alpha1 . Then again, I was having trouble using the previous release version.)
I had to make the following changes to the "media.install" file in order for the "update.php" script to work for me.
I had to comment out these lines inside the media_update_dependencies() function.
I also had to comment out the entire media_update_7200() function.
I'm using Drupal 7.23 with ctools 7.x-1.3, entity 7.x-1.2, File entity 7.x-2.0-alpha1, and a few other modules.
Comment #29
ParisLiakos CreditAttribution: ParisLiakos commentedtry upgrading to alpha2, i believe you want have problems there