Posted by xjm on March 18, 2011 at 5:39pm
3 followers
| Project: | Taxonomy Access Control |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | xjm |
| Status: | closed (fixed) |
Issue Summary
Update the module admin forms for D7.
Comments
#1
Here's a first pass. The admin forms aren't fully working after this (not by any means) but they do whitescreen less often than they did before :)
I tried to focus mostly on the code in taxonomy_access_admin.inc (even though many API functions called from there are still broken). So it might be at a pretty good committable state.
#2
Well, global defaults can be configured, at least. Looks like some of the helper functions need to have their new queries committed before configuring terms or defaults will work. I'll migrate those.
#3
#4
http://drupalcode.org/project/taxonomy_access.git/commit/b07689d
#5
Great, glad you were able to finish those up. I guess I didn't fully appreciate that if I signed up to "make the admin forms work in D7", doing that completely would basically be the equivalent of porting the entire module to D7 :)
#6
Skimming through the committed patch, in _taxonomy_access_get_nodes_for_vocabulary():
- // Exclude nodes with those terms from the results.- $query .=
- " AND n.tid NOT IN (" . db_placeholders($tids, 'int') . ")";
....
+ // Exclude nodes with controlled terms from the results.
+ $query->condition('ti.tid', $tids, 'IN');
Is this change actually right? Looks like it switched from NOT IN to IN...
+ db_select('taxonomy_index', 'ti')+ ->condition('td.vid', $vid)
+ ->fields('ti', array('nid'))
+ ;
+ $query->join('taxonomy_term_data', 'td');
This doesn't specify what columns to join on - I assume it needs to?
#7
Whoops. That probably explains why node access was corrupted a few times while I was testing the patch; I'd assumed it had something to do with the as-yet-unfinished node API changes. I thought the second bit (without an explicit "ON") was supposed to automatically use a matching key name if one was present, but I tested it and it doesn't actually return the same records.
http://drupalcode.org/project/taxonomy_access.git/commit/a3d65f2
In light of this I think #903120: Add test suite should probably be completed before a 7.x-1.0 release.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.