对用户权限的更改未保存

发布于 2024-09-03 12:12:25 字数 239 浏览 4 评论 0原文

我正在使用drupal 6。

似乎权限页面无法保存太多设置。

我尝试保存权限设置,但它只是没有保存到数据库中。 我发现这是由于“字段太多”造成的。 (使用内容许可模块)。 如果我取消选中某些字段,然后检查较少的字段,则将保存权限。

例如,如果我取消选中 2 个复选框,然后选中一个复选框,则权限将被保存。

有谁知道权限页面使用哪个函数将结果插入数据库?

我的php内存限制是256M。

I am use drupal 6.

it seems like permission page can not save too many settings.

I have try to save permission setting, but it is just not saved into DB.
I have found out this is due to "too many fields". (use content permission module).
if i uncheck some fields, and then checking lesser fields, permission will be saved.

for example, if I am unchecking 2 check boxes, then checking one check box, permission will be saved.

does any one know which function the permission page used to insert result into db?

my php memory limit is 256M.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

初见你 2024-09-10 12:12:25

您需要调整 php.ini 中的 max_input_vars。通常的默认值是 1000,但是对于很多模块,Drupal 权限页面很容易超过这个值。如果您有权访问 php.ini 并重新启动 apache,只需添加另一个零并将其设置为 10000。 php.ini 文件的位置取决于您的服务器配置。

我遇到了同样的问题,错误日志中没有错误,这为我解决了它。

You need to adjust the max_input_vars in php.ini. The usual default is 1000, but with a lot of modules, the Drupal permissions page easily eclipses this. Just add another zero and make it 10000 if you have access to php.ini and restart apache. The location of the php.ini file depends on your server configuration.

I had the same issue, with no errors in the error log, and this fixed it for me.

池予 2024-09-10 12:12:25

对于您遇到的问题,这里有一个很好的解释:http://2bits.com/drupal/drupal-not- saving-admin-pages-large-number-input-fields.html

There is a good explanation of the issue that you are having here: http://2bits.com/drupal/drupal-not-saving-admin-pages-large-number-input-fields.html

ぺ禁宫浮华殁 2024-09-10 12:12:25

更改数据库表的大小?听起来像是被截断了。

Change the size of the db table? Sounds like its truncating.

囍孤女 2024-09-10 12:12:25

将权限保存到数据库的函数是user_admin_perm_submit()

function user_admin_perm_submit($form, &$form_state) {
  // Save permissions:
  $result = db_query('SELECT * FROM {role}');
  while ($role = db_fetch_object($result)) {
    if (isset($form_state['values'][$role->rid])) {
      // Delete, so if we clear every checkbox we reset that role;
      // otherwise permissions are active and denied everywhere.
      db_query('DELETE FROM {permission} WHERE rid = %d', $role->rid);
      $form_state['values'][$role->rid] = array_filter($form_state['values'][$role->rid]);
      if (count($form_state['values'][$role->rid])) {
        db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $role->rid, implode(', ', array_keys($form_state['values'][$role->rid])));
      }
    }
  }

  drupal_set_message(t('The changes have been saved.'));

  // Clear the cached pages
  cache_clear_all();
}

The function that saves the permissions in the database is user_admin_perm_submit().

function user_admin_perm_submit($form, &$form_state) {
  // Save permissions:
  $result = db_query('SELECT * FROM {role}');
  while ($role = db_fetch_object($result)) {
    if (isset($form_state['values'][$role->rid])) {
      // Delete, so if we clear every checkbox we reset that role;
      // otherwise permissions are active and denied everywhere.
      db_query('DELETE FROM {permission} WHERE rid = %d', $role->rid);
      $form_state['values'][$role->rid] = array_filter($form_state['values'][$role->rid]);
      if (count($form_state['values'][$role->rid])) {
        db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $role->rid, implode(', ', array_keys($form_state['values'][$role->rid])));
      }
    }
  }

  drupal_set_message(t('The changes have been saved.'));

  // Clear the cached pages
  cache_clear_all();
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文