Updated :

Removed all the db_result queries and replaced them with valid D7 code
Removed all the db_fetch_array and replaced them with valid D7 code
Converted the priority from an array based system to the D7 object system

CommentFileSizeAuthor
drupal7_adjustments.patch3.12 KBnick_vh

Comments

salvis’s picture

Great, thanks!

This looks good, except for:

+++ acl.module	13 May 2010 16:33:30 -0000
@@ -128,29 +128,30 @@ function acl_node_clear_acls($nid, $modu
+  //rewrite count query

What do you mean with this comment?

nick_vh’s picture

I don't know anymore.. I guess it was a pointer for me that that query didn't work before. You can safely ignore that.

More updates will come soon together with their corresponding tests :-)

salvis’s picture

Status: Active » Fixed

Ok, I dropped the comment and committed everything else, thanks!

http://drupal.org/cvs?commit=367706

BenK’s picture

Just tracking this thread...

salvis’s picture

This thread is done, but you might help with testing...

BenK’s picture

I'd be glad to help with testing, but most of my use of ACL has been in conjunction with the Content Access module. As far as I know, there hasn't been any work on a Content Access D7 port yet.

I suppose one possibility would be to run Coder Upgrade on Content Access and see what happens... but I'm not sure of how close that would get me.

--Ben

salvis’s picture

Last time I used Coder Upgrade it didn't do anything to the database calls, so there's a lot of additional manual work, but anything that brings a module closer to D7 is helpful.

Status: Fixed » Closed (fixed)

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

BenK’s picture

Status: Closed (fixed) » Active

Hey everyone,

salvis suggested I reopen this thread. I just tried using ACL in conjunction with the D7 version of the Content Access module, but I got a white screen of death when trying to display the "Access control" tab of a given node. Looking in the error logs, this was the error message:

PHP Fatal error: Call to undefined function db_result() in /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/acl/acl.admin.inc on line 16, referer: http://sandbox10.testsite.org/node/2

Any thoughts on how to fix?

Thanks,
Ben

BenK’s picture

Hey salvis or Nick_vh,

Any idea how to solve the issue posted in #9?

Thanks,
Ben

BenK’s picture

Status: Active » Needs work
salvis’s picture

Please try this:

    if (!$acl_name = db_query("SELECT name FROM {acl} WHERE acl_id = :acl_id", array(
      'acl_id' => $acl_id,
    ))->fetchField()) {
      return array();
    }
BenK’s picture

Hey salvis,

I tried your fix in #12 and now I'm getting the following error message:

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'grant_update' at row 1: INSERT INTO {acl_node} (acl_id, nid, grant_view, grant_update, grant_delete, priority) 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); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => 0 ) in acl_node_add_acl() (line 96 of /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/acl/acl.module).

Any ideas?

Thanks so much for your help,
Ben

salvis’s picture

This is a bug in Content Access: #824642: D7: Error Message When Viewing a Node's "Access Control" tab (ACL with Content Access module). It fails to pass the required 0's and pgsql stubbornly refuses to make trivial type conversions (which is a bug in pgsql IMO).

Actually, it was you who reported that other issue...

I believe that code should be reasonably robust against misbehavior of others and I committed a work-around to the ACL -dev version a week ago. So, update ACL and re-apply #12...

BenK’s picture

Hey salvis,

Oops, my mistake. I had overwritten the suggested change in #824642 inadvertently. Once I put that fix back in, I was able to load the "Access Control" tab successfully and see the "User access control lists" section at the bottom. Sorry about that. Thanks again for your help.

So I've confirmed that your change in #12 works perfectly. Can you commit #12 as soon as you have a chance? We're making progress!

Moving on with testing, I actually tried to add a user to an ACL, but the "Add user" button didn't seem to work (the page reloads, but nothing happens). After a few times of attempting this, an "Integrity constraint violation" error message is shown. I will post a new issue thread about this....

--Ben

salvis’s picture

Status: Needs work » Fixed

Committed to the -dev version. Give it up to 12h to be repackaged.

Thanks!

Status: Fixed » Closed (fixed)

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