summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalvis2010-07-03 09:15:58 (GMT)
committer salvis2010-07-03 09:15:58 (GMT)
commit7613d2926915542b8e480879ab913cc107ba4959 (patch)
treedf60df7cda5257c9e50d647d60a842397f8a8ecb
parent056479151e0986138d5b038c6c8ef00a552384fb (diff)
#836822: Fix some porting errors, by atchijov, salvis, BenK.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--acl.admin.inc7
-rw-r--r--acl.module8
3 files changed, 8 insertions, 8 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 0f63718..ab43b19 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -4,6 +4,7 @@ acl 7.x-1.x-dev:
Enhancements:
- Add acl_has_user($acl_id, $uid) API function.
Port to D7:
+ - #836822: Fix some porting errors.
- Fix line endings (no functional change).
- #798106: Convert another left-over db_result() call.
- #824642: Avoid type conversion problems when FALSE is passed rather than 0.
diff --git a/acl.admin.inc b/acl.admin.inc
index 2772224..3f2b3fc 100644
--- a/acl.admin.inc
+++ b/acl.admin.inc
@@ -85,15 +85,14 @@ function _acl_edit_form_after_build($form, $form_state) {
$user_list = unserialize($form['user_list']['#value']);
$button_name = 'acl_' . $form['acl_id']['#value'];
- if (isset($form['#post'][$button_name]) && $form['#post'][$button_name] == $form['delete_button']['#value']) {
+ if (isset($form_state['triggering_element']) && $form_state['triggering_element']['#value'] == $form['delete_button']['#value']) {
$deletions = $form['deletions']['#value'];
foreach ($deletions as $uid) {
unset($user_list[$uid]);
unset($form['deletions']['#value'][$uid]);
}
}
- elseif (isset($form['#post'][$button_name]) && $form['#post'][$button_name] == $form['add_button']['#value']) {
-
+ elseif (isset($form_state['triggering_element']) && $form_state['triggering_element']['#value'] == $form['add_button']['#value'] && !empty($form['add']['#value'])) {
$user = db_query("SELECT uid, name FROM {users} WHERE name = :name", array(
'name' => $form['add']['#value'],
))->fetchObject();
@@ -132,7 +131,7 @@ function acl_save_form($form, $priority = NULL) {
->condition('acl_id', $form['acl_id'])
->execute();
foreach ($users as $uid => $name) {
- db_insert('')
+ db_insert('acl_user')
->fields(array(
'acl_id' => $form['acl_id'],
'uid' => $uid,
diff --git a/acl.module b/acl.module
index 072097b..f0c6e18 100644
--- a/acl.module
+++ b/acl.module
@@ -176,11 +176,11 @@ function acl_node_access_records($node) {
}
$result = db_query("SELECT n.*, 'acl' AS realm, n.acl_id AS gid, a.module FROM {acl_node} n INNER JOIN {acl} a ON n.acl_id = a.acl_id WHERE nid = :nid", array(
'nid' => $node->nid,
- ));
+ ), array('fetch' => PDO::FETCH_ASSOC));
$grants = array();
foreach ($result as $grant) {
- if (module_invoke($grant->module, 'enabled')) {
- if (acl_has_users($grant->gid)) {
+ if (module_invoke($grant['module'], 'enabled')) {
+ if (acl_has_users($grant['gid'])) {
$grants[] = $grant;
}
else {
@@ -191,7 +191,7 @@ function acl_node_access_records($node) {
'grant_view' => 0,
'grant_update' => 0,
'grant_delete' => 0,
- 'priority' => $grant->priority,
+ 'priority' => $grant['priority'],
);
}
}