Getting error

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'simple_access_user_new_acl' for column 'acl_id' at row 1: 
INSERT INTO {acl_user} (acl_id, uid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => simple_access_user_new_acl [:db_insert_placeholder_1] => 9 ) in acl_save_form() (line 138 of /var/www/d7/sites/all/modules/contrib/acl/acl.admin.inc).

Per documentation in the code, this is called using

    $form['users'] = acl_edit_form($form_state, 'simple_access_user_new_acl', t('Users'), TRUE);

which obviously is not handled by acl_edit_form() or rather _acl_edit_form().

/**
 * Provide a form to edit the ACL that can be embedded in other forms.
 * Pass $new_acl=TRUE if you have no ACL yet, but do supply a string
 * like 'my_module_new_acl' as $acl_id anyway.
 */
function acl_edit_form(&$form_state, $acl_id, $label = NULL, $new_acl = FALSE) {
...

Comments

salvis’s picture

Status: Active » Closed (works as designed)

We do not have the information that we'd need for creating the ACL on behalf off the client module.

I think I should update the comment as follows:

/**
 * Provide a form to edit the ACL that can be embedded in other forms.
 *
 * Pass $new_acl=TRUE if you have no ACL yet, but do supply a string
 * like 'my_module_new_acl' as $acl_id anyway; create the ACL and set
 * $form['acl_id'] before calling acl_save_form().
 */

Does that make sense?

ckng’s picture

Yes, it is clearer with the new comment.

salvis’s picture

Ok, thank you.

Pushed to the -dev version.