I found this problem in Content Type page.

#overlay=admin/structure/types/manage/CONTENT TYPE NAME/access

Notice: Array to string conversion in form_process_checkbox() (line 3140 of C:\xampp\htdocs\includes\form.inc).

after i summit the setting, it show me error message.

Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of C:\xampp\htdocs\sites\all\modules\content_access\content_access.admin.inc).
Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of C:\xampp\htdocs\sites\all\modules\content_access\content_access.admin.inc).
Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of C:\xampp\htdocs\sites\all\modules\content_access\content_access.admin.inc).
Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of C:\xampp\htdocs\sites\all\modules\content_access\content_access.admin.inc).
Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of C:\xampp\htdocs\sites\all\modules\content_access\content_access.admin.inc).
Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of C:\xampp\htdocs\sites\all\modules\content_access\content_access.admin.inc).
Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of C:\xampp\htdocs\sites\all\modules\content_access\content_access.admin.inc).
Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of C:\xampp\htdocs\sites\all\modules\content_access\content_access.admin.inc).
Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of C:\xampp\htdocs\sites\all\modules\content_access\content_access.admin.inc).
Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of C:\xampp\htdocs\sites\all\modules\content_access\content_access.admin.inc).
Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of C:\xampp\htdocs\sites\all\modules\content_access\content_access.admin.inc).
Notice: Undefined index: type in content_access_admin_settings_submit() (line 180 of C:\xampp\htdocs\sites\all\modules\content_access\content_access.admin.inc).
Notice: Undefined index: edit any content in user_role_grant_permissions() (line 3041 of C:\xampp\htdocs\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] => 3 [:db_insert_placeholder_1] => edit any content [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3043 of C:\xampp\htdocs\modules\user\user.module).

CommentFileSizeAuthor
#16 php54.patch475 bytesomerida
#11 content_acess.patch1.13 KBdroplet
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zietbukuel’s picture

Version: 7.x-1.x-dev » 7.x-1.2-beta1
Category: support » bug

I've got this error too and I cannot edit permissions.

info@raceeend.nl’s picture

I've got the same error on an IIS 7.5 webserver when editing the permissions in a content type. But it's possible to edit the permissions on a separate node.
When I copied the website to an apache enviroment (within VS.PHP), everything works fine. The permissions are editable on the contenttype and on a separate node.

seppola’s picture

I'm experiencing the same issue with the following configuration:
- PHP Version 5.4.6
- IIS 7.5
- Drupal 7.15

zietbukuel’s picture

I changed the line 180 to:

$permission = content_access_get_permission_by_op($op, $form_state['build_info']['args']['0']->type);

And it worked for me.

saavyone’s picture

I followed zietbukuel's code (Thanks!) and still got another error a few lines down. So I took the hack one step further:

//added line here to assign it to the 'type' index of the $form_state array, not just reference once
      $form_state['type'] = $form_state['build_info']['args']['0']->type;
//original line 180, now 181, not using zietbukuel's code anymore
      $permission = content_access_get_permission_by_op($op, $form_state['type']);
korn3lius’s picture

#5 worked for me
Thanks a lot

Ole Martin’s picture

Can anyone tell me which file and what to change?
In the "content_access.module"-file I have only:
178. / **
179. * Implements hook_disable ().
180. * /
181. content_access_disable function () {
182. content_access_disabling (TRUE);
183. }

Thanks.

Ole Martin’s picture

Sorry, I saw it now from the error message
"modules\content_access\content_access.admin.inc"
And it's was #5 who fix it for me.
Thanks.

mittina’s picture

I've got this error when enabling 'PER CONTENT NODE ACCESS CONTROL SETTINGS' for a created content type.
Drupal 7.15, and
Had WAMP 2.2. with PHP 5.4.3 and Apache 2.2.22.

Workaround:
Downgrade to PHP v.5.3 solved the issue, too.

John Deefull’s picture

#5 didn't work for me.
;-) sorry.

and I have no right to down the PHP version...

droplet’s picture

Title: Notice: Array to string conversion in form_process_checkbox() (line 3140 of C:\xampp\htdocs\includes\form.inc). » Notice: Undefined index: type in content_access_admin_settin (Integrity constraint violation: 1048 Column 'module' cannot be ).
Version: 7.x-1.2-beta1 » 7.x-1.x-dev
Priority: Major » Critical
Status: Active » Needs review
FileSize
1.13 KB

Totally not working, raising priority.

(2 & 3rd changes improve the code only. 1st is the code fix.)

Anonymous’s picture

The patch in #11 did not work for me, with PHP 5.4.7.
Instead of getting lines like this :
Notice : Undefined index: type dans content_access_admin_settings_submit() (line 180)
I get :
Notice : Undefined variable: type dans content_access_admin_settings_submit() (line 180)

And the process fail for it still ends with the PDOException :
PDOException : SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null

droplet’s picture

@Pozzo,

what's your Content Access version. I tested with PHP 5.4.4 & Content Access dev

Anonymous’s picture

Indeed, it works way better with this version of content access and the patch!
Thanks a lot!

IcanDivideBy0’s picture

#11 worked for me too.
Thanks

omerida’s picture

FileSize
475 bytes

For the beta release, this patch should be sufficient to prevent this error when running in a PHP 5.4 environment.

likewhoa’s picture

Status: Needs review » Reviewed & tested by the community

works for me, thanks!

Nicolas Bouteille’s picture

I confirm that #16 was enough for me to make content access work with a per node granularity with PHP 5.4.4 and the dev version of december 2011.

By the way what's up with this module ? How is it there are no commits for one year ? I am starting to find more and more modules like that such as Loggin Toboggan and Email Register... and there are others... is Drupal dying or what ? Do you think maintainers choosing other CMS ?

jessepinho’s picture

#11 won't work, because $type is not yet defined in the scope in which it's being called. #16 works for me.

droplet’s picture

well...#11 & #16 doing same thing if you using dev version

jessepinho’s picture

Woops, sorry, wasn't using the dev version and didn't realize that's what this issue was referring to. My bad!

schnippy’s picture

Just ran into this issue as well and omerida's patch at #16 worked as expected for us -- cleared out warning notices and sql fatal error. Thanks Oscar!

rudiedirkx’s picture

All of that ^ is not necessary.

All that's necessary is changing

function content_access_admin_settings($form, $form_state, $content_type) {

to

function content_access_admin_settings($form, &$form_state, $content_type) {

or simply adding a & before $form_state.

As you can see in the quickstart quide the $form_state in the form function itself has to be by-reference.

Without it, adding

  $form_state['type'] = $type;

in the form function is useless, because it will never leave the initial form definition (and will never be available in content_access_admin_settings_submit()).

If that wasn't the problem, you're using a strange PHP...

blogsh’s picture

#23 fixes the problem for me on PHP 5.4.7

omerida’s picture

Guess what the patch in #16 does. I provided a patch file because that makes it easy to apply the change (yes, even if its one line).

zietbukuel’s picture

Can someone please make a working patch? (I'm kinda confused now, there are lots of fixes here). Thanks.

likewhoa’s picture

@zietbukuel if you pay attention you would notice #16 is a *working* and simple patch.

zietbukuel’s picture

Oh sorry about it, I'll check it out. Thanks!

rudiedirkx’s picture

Yes. #16.

claira’s picture

#16 worked!

everpat’s picture

#16 also worked for me, but only with the dev version.

Beezer75’s picture

#23 seems to have done the trick for me. I'm using the 7.x-1.x-dev version, I didn't try it with 7.x-1.2-beta1

likewhoa’s picture

@chris@bohnsackd please try the much simpler patch in #16

rudiedirkx’s picture

@likewhoa That's the same. Only #23 isn't a patch.

Can someone call someone to tell someone to commit this? I don't know anyone.

norgo’s picture

changing line 115 in the dev version with patch in #16 worked for me.

gambry’s picture

#23 works for me, version 7.x-1.2-beta1 PHP 5.4.6

fago’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

LedZelkin’s picture

Thanks this patch save my day :)

Status: Fixed » Closed (fixed)

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