tac_lite
I have the following headaches after enabling the tac_lite module:
>> Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) AND t.vid = 1 ORDER BY weight, name' at line 1 query: SELECT t.tid, t.*, parent FROM term_data t INNER JOIN term_hierarchy h ON t.tid = h.tid LEFT JOIN term_data catd ON t.tid = catd.tid WHERE (t.tid IN (0) OR catd.vid NOT IN ()) AND t.vid = 1 ORDER BY weight, name in /home/.../includes/database.mysql.inc on line 120
(Going to site/modules and issueing the command "rm tac_lite" instantly solves this problem, but I need restricted access on the site so I re-enabled tac_lite.)
Ok, I did run update.php (without errors) and returning to the adminstration pages got this:
Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) AND t.vid = 1 ORDER BY weight, name' at line 1 query: SELECT t.tid, t.*, parent FROM term_data t INNER JOIN term_hierarchy h ON t.tid = h.tid LEFT JOIN term_data catd ON t.tid = catd.tid WHERE (t.tid IN (0) OR catd.vid NOT IN ()) AND t.vid = 1 ORDER BY weight, name in /.../includes/database.mysql.inc on line 120
Warning: Cannot modify header information - headers already sent by (output started at /home/krooninf/public_html/.../includes/database.mysql.inc:120) in /home/.../modules/xtra/devel/devel.module on line 366
(Devel module is not the culprit here, its just trying to write output at this stage)
Some other Info:
* Drupal 4.7.2
* Happens with tac_lite in CVS as well as tac_lite in 4.7
* PHP Version 4.4.2
* MySQL 4.1.20
Yep, ok I searched and these modules described similar pains without offering real solutions:
http://drupal.org/node/73762
http://drupal.org/node/63804
http://drupal.org/node/58051
http://drupal.org/node/35145 (this post actually describes my error, but ...)
Comments
Test site works fine
FWIW,
I have a test site with an earlier version of the data where the tac_lite module works without errors.
At this moment the particular site is a type of blog containing precisely 50 different posts. Since I am faced with editing each and every individual story/node in any case to make the content available to everybody (as per the tac_lite instructions), I might as well cut and paste those 50 stories into a new site to get rid of the above errors - I have spent exactly three days banging my head against the tac_lite wall and this way will be much quicker.
NOTE: The seniors of the Drupal community should look seriously at the tac_lite module. The ability to assign access to content on the basis of either a per-user, or per-category item, is something that is incredibly useful and sooner or later most Drupal sites will benefit from such functionality if only for a single node/user! Either this module or this functionality should IMHO be a core function of Drupal out-of-the-box! At present tac_lite has to be added on with considerable difficulty for existing sites while very few new sites will be set up with tac_lite to start with!
:-)
Casper Labuschagne
Where am I on the Drupal map on Frapper?
hierarchy need
I would like to second the above comment with regards to the need for a decent access control DESIGNED INTO the system, rather than all these various add-ons, which work one way or another but in various directions, none of them supremely elegant.
I can only imagine that there must be many many users out there who would like the flexibility and general installation-friendliness of Drupal, but who need a little more structure than it provides easily....
At the same time, it would be nice if the permissions system permitted a little more fine-grain assignment to roles: something between access level and administer... like Unix with read, write, create, delete, etc etc... :)
The code should be changed
The code should be changed so that you see a useful error message instead of broken SQL. That said, I think you simply need to
a) create some taxonomies (aka categories)
b) go to administer >> access control >> tac_lite and select the taxonomies that affect privacy.
As for the re-saving of all your nodes, this must be done to ensure the proper privacy is set. However if you simply want to make all nodes visible to all users, try something like this (after backing up your database):
Also, use DRUPAL-4-7 version with Drupal 4.7.x.
Insert where?
TAC-lite sounds like a really useful module, but many users will (like me) want to retro-fit it as a site develops without risking the site becoming invisible to visitors. In my case, I have too much content to resubmit everything.
Please advise how to use this INSERT INTO line?
Can I use it through PHP-admin?
If it is just this single line of instruction, wouldn't it be a good idea to include it in the set-up?
Or is there a danger it will break things?
Thanks
phpMyAdmin
Yes, one way to run this line of SQL is through phpMyAdmin. Let us know here if you're not sure where or how to do this in phpMyAdmin.
And absolutely, I agree this sort of tidying should be built into the module! Check my other comment though -- it may not work in all circumstances.
_________
http://marmaladesoul.com
Thanks
Thanks for sharing that SQL; it definitely saves some time. I'm not sure whether it works in every situation though. It fixed all my page nodes but not my forum posts. Manually editing each forum post did the trick (fortunately I didn't have many yet), but any thoughts on why this SQL would not have fixed access for the forum posts?
Looking at my node_access database table, I noticed lots and lots of rows which were related to taxonomy_access which I had tried using previously without much joy. In the end I (somewhat nervously) decided to:
* backup my database
* disable the tac_lite module
* remove all the lines from my node_access database table, except for the default line (0, 0, all, 1, 0, 0)
* enable the tac_lite module
* run your SQL code
This seems to have worked fine, except for my forums which I fixed as noted above.
_________
http://marmaladesoul.com
That sounds odd. It would
That sounds odd. It would have been useful to inspect the node_access table before and after you ran the command.
The devel_node_access module is useful for these things (watch the tutorial I just commented about).
More info
I re-loaded my backup database and have uploaded the SQL for the node_access table here. Then I ran your SQL, which resulted in the following error:
_________________________
External process terminated abnormally. Exit value: 1
Error: ERROR 1062 (23000) at line 1: Duplicate entry '41-0-tac_lite' for key 1
_________________________
I then turned off the tac_lite module, deleted all but the default 0, 0, all, 1, 0, 0 row, and turned the module back on. Next I re-ran your SQL, which ran without errors this time.
In admin/access/tac_lite I checked, and my "forums" vocab was already chosen, however I saved config again anyway.
Under admin/access/tac_lite/roles I gave anon access to one forum, number 3. When I go to /forum as an anon user, I see just this forum listed, like I should.
HOWEVER, when I visit /forum/4 as anon, I see everything, including forum posts. When I click on a forum post, I see the node heading but no body. Very strange.
My "after-all-the-above" node_access table SQL is here.
Let me know if I can provide anything else, or if you think this is just an isolated case of strangeness :)
_________
http://marmaladesoul.com
After you run the INSERT
After you run the INSERT SQL, your anon user should see all nodes. The fact that you can see the titles but not the bodies surprises me. I suspect the forum module is doing something with the taxonomy term (which the anon user can no longer see) and when it's not found it fails to display the node.
If you become administrator again, re-save all the nodes in forum/4 things should be right. You need to resave any node that's under access control.
-Dave
Sorry :(
Turns out the strange forum behaviour was due to a partially-worked-on-but-incomplete node-forum.tpl.php theme file :( Sorry to waste your time.
_________
http://marmaladesoul.com
I just wanted to mention on
I just wanted to mention on this thread that I posted a video tutorial of how to use the tac_lite module:
http://dave-cohen.com/node/1170