hi there
i get a PDO Exeption if i try to set the permissions for any content type

drupal 7.12
Database system MySQL, MariaDB, or equivalent
Database system version 5.0.95-log
Database updates Up to date
PHP 5.4.0

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] => 2 [:db_insert_placeholder_1] => edit any content [:db_insert_placeholder_2] => )

CommentFileSizeAuthor
#13 content_access.diff1.27 KBhgneng

Comments

1kubik’s picture

Version: 7.x-1.x-dev » 7.x-1.2-beta1

same Problem with 7.x-1.2-beta1 Version

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] => 3 [:db_insert_placeholder_1] => edit any content [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3030 of /var/www/html/modules/user/user.module).

do iam the only one with this problem?

its a brand new drupal 7.12 installation
and a
PHP Version 5.4.0

if go to the content type access admin on
admin/structure/types/manage/article/access
it shows a Notice
'Notice: Array to string conversion in form_process_checkbox() (line 3057 of /var/www/html/includes/form.inc).'

japanitrat’s picture

same but different. I can't get the content access permissions rebuilt.

HTTP Result Code: 500 Debugging information follows. Path: /.../batch?id=113&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'author' for column 'gid' at row 1: INSERT INTO {node_access} (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5), (:db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11), (:db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17); Array ( [:db_insert_placeholder_0] => 118 [:db_insert_placeholder_1] => content_access_rid [:db_insert_placeholder_2] => author [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 118 [:db_insert_placeholder_7] => content_access_rid [:db_insert_placeholder_8] => 2 [:db_insert_placeholder_9] => 1 [:db_insert_placeholder_10] => 0 [:db_insert_placeholder_11] => 0 [:db_insert_placeholder_12] => 118 [:db_insert_placeholder_13] => content_access_rid [:db_insert_placeholder_14] => 3 [:db_insert_placeholder_15] => 1 [:db_insert_placeholder_16] => 1 [:db_insert_placeholder_17] => 1 ) in node_access_write_grants() (line 3392 of ...\modules\node\node.module).

solvemon’s picture

Same here:

D7.14

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] => 3 [:db_insert_placeholder_1] => edit any content [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3034 of /usr/share/drupal7/modules/user/user.module).

roland.wells’s picture

Same problem here:
Drupal 7.14
PHP 5.4.3

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] => 3 [:db_insert_placeholder_1] => edit any content [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3034 of /home/ubs/public_html/modules/user/user.module).

roland.wells’s picture

this seems to only occur with PHP 5.4.x , I've tested same site with php 5.3.6 and it works fine

roelw’s picture

Priority: Normal » Critical

I have this issue on my production server of my hosting service that uses php 5.4.4-2 and drupal 7.14.
A test version of that same site running under Drupal 7.12 on my home server works fine (it uses php 5.3.6-13ubuntu3.6).

I have no idea how to solve it or what to do :-(

Earlier today I installed the Libraries, Media and jPlayer modules. Could that also have something to do with it ?

roland.wells’s picture

my site does not have Media or jPlayer modules, and I uninstalled the Libraries module to test. Still exeperiancing the same behavior on PHP 5.4x .

PHP 5.3 works fine with the same site (regardless of whether Libraries module is installed or not).

DrupalDesigner-1’s picture

Assigned: Unassigned » DrupalDesigner-1

Yep same thing here, happens when I try to set permissions for any content type:

Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of ...sites\all\modules\content_access\content_access.admin.inc).

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] => 3 [:db_insert_placeholder_1] => edit any content [:db_insert_placeholder_2] => ) in user_role_grant_permissions()

And when going to the content type access admin on
admin/structure/types/manage/article/access
it also shows a Notice as mentioned above:

'Notice: Array to string conversion in form_process_checkbox() (line 3057 of /var/www/html/includes/form.inc).'

I am using PHP 5.4x and Drupal 7.14 aswell. Would really appreciate some suggestions for this.

DrupalDesigner-1’s picture

Can confirm that using PHP 5.3x and Drupal 7.15 gets rid of the errors. Had to reinstall because it completely broke my site.

salvis’s picture

Install Devel module, enable its Backtrace error handler, and report the call stack(s) leading to the error(s).

romaingar’s picture

Confirm too : PHP 5.4.4 and Drupal 7.14
Is someone find a solution ?
thanks

I've tested to apply this patch : http://drupal.org/node/1249952
who describe the same issue caused by the fact that le function user_role_grant_permissions receive a module who is not activated. In our case, the module name doesn't exist because the function doesn't receive the second argument : $premissions
I've did'nt find where this function is called...
Maybe someone could help me to investigate on this bug.
bye !

hgneng’s picture

Same problem here with PHP 5.4.4 and Drupal 7.14

hgneng’s picture

StatusFileSize
new1.27 KB

I've attached a solution. It seems caused by the value of $form_state['type'] lost. But I don't know why.

k.skarlatos’s picture

This seems to work ok for me. Thanks!

dr_cop’s picture

Priority: Critical » Major
Status: Active » Patch (to be ported)

Also for saving 'views' permissions per content type you should replace this:

unset($settings[$setting][$form_state['type']]);
    if (isset($form_state['values'][$setting])) {
      $settings[$setting][$form_state['type']] = is_array($form_state['values'][$setting]) ? array_keys(array_filter($form_state['values'][$setting])) : $form_state['values'][$setting];
    }

on that:

unset($settings[$setting][$form_state['type']]);
    if (isset($form_state['values'][$setting])) {
      $settings[$setting][$type] = is_array($form_state['values'][$setting]) ? array_keys(array_filter($form_state['values'][$setting])) : $form_state['values'][$setting];
    }

Routh’s picture

Has this been incorporated into dev yet? I'm also experiencing this with PHP 5.4

Routh’s picture

Well, I just attempted that patch and it failed. Still stuck with this.

likewhoa’s picture

patch in #18 works.

fago’s picture

Status: Patch (to be ported) » Closed (duplicate)
robladdish’s picture

Issue summary: View changes

Still a problem in June 2016. Drupal commons distribution will not load on Apache, PHP, MySQL - all latest versions. Backtracking versions is very time consuming. I tried older versions of PHP and Mysql - no go. I've just tried php 5.3.6, but now looks like I'd have to downgrade apache to 2.2 instead of 2.4. I feel real bad about going back many years as I'm sure there are security patches in the meantime. It'd be awesome if drupal commons could be patched to finally work around this issue. (SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'rid' cannot be null)