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.
We tried to install Hangouts on a PostgreSQL-based Drupal site and get the following error on install:
Notice: Undefined index: view files in user_role_grant_permissions() (line 3074 of /home/profilees/public_html/modules/user/user.module).
PDOException: SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block: SELECT 1 AS expression FROM {role_permission} role_permission WHERE ( (rid = :db_condition_placeholder_0) AND (permission = :db_condition_placeholder_1) ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => view files ) in user_role_grant_permissions() (line 3076 of /home/profilees/public_html/modules/user/user.module).
From the PostgreSQL logs, I see this:
2013-06-13 12:15:06 EDT ERROR: null value in column "module" violates not-null constraint
2013-06-13 12:15:06 EDT STATEMENT: INSERT INTO role_permission (rid, permission, module) VALUES ('1', 'view files', NULL)
2013-06-13 12:15:06 EDT ERROR: current transaction is aborted, commands ignored until end of transaction block
2013-06-13 12:15:06 EDT STATEMENT: SELECT 1 AS expression
FROM
role_permission role_permission
WHERE ( (rid = '1') AND (permission = 'view files') ) FOR UPDATE
I'm not sure what's going on with this. It looks like it's trying to give the 'view files' permission to role 1, and is failing. I'm not sure why this would come up on install of this module, as I see no .install file in the module.
Comments
Comment #1
Ben Coleman CreditAttribution: Ben Coleman commentedThis turns out to be coming from the Debut Media module. I suspect this is something that MySQL may silently ignore, but PostgreSQL is typically more persnickety about. Seems that this comes up upon enabling any module after installing Debut Media.
Comment #2
Ben Coleman CreditAttribution: Ben Coleman commentedWe've pulled Debut Media off of the original site. I installed it manually on a scratch Drupal 7/PostgreSQL site and got the following on install:
I do note that there are no Drupal Media permissions showing on the permissions page. Note that the last notice is pretty much identical to the one that came up on the original site. I so far can't reproduce the original problem, that after installing Debut media, I can't enable other modules, but I think the original site installed via the Apps mechanism. That may make a differennce.
Comment #3
Ben Coleman CreditAttribution: Ben Coleman commentedComment #4
nedjoThanks for the bug report. The relevant code forces creation of the feature's items at install time rather than the default Features behaviour of doing so on cache clear, which can trigger timeouts.
What's apparently happening here is that the feature_load() doesn't return the debut_media feature, leading to a series of further errors.
Likely the best fix - here and in all the other Debut features - is to test for the loaded feature before acting on it:
Comment #4.0
nedjoFix missing end > on first code block
Comment #5
nedjoWe can now remove the code that triggered this issue, since #1572578: Rethink the way features are enabled / disabled addressed the same need.
Comment #7
Ben Coleman CreditAttribution: Ben Coleman at Accelerated Design, Inc. commentedThis should have been closed with the commit.