This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Controlling Access To pages by Taxonomy (alternative to the buggy taxonomy_access.module)

A topic that makes people cry, especially if they have used Taxonomy_Access.module previously.

I've just been looking over the various functions that the taxonomy_access.module does and wondered if it would be possible to simplify this. rather than jumping in and developing a new module to test this I wondered if people could point out problems beforehand.

Here's the idea.

Everytime a node is about to be rendered for viewing, the new module would check the associated taxonomy term ids via the hook_nodeapi() function.

If the current viewing users role doesn't match the permission table for any of the taxonomies associated with the node in question, redirect the user to the Drupal 403 error page.

Special case

If the node path matches that of the 404 or 403 error nodes defined in the main admin->settings then always return true to prevent server 500 errors due to 403 caused by ErrorDocument not being available to Apache.

Patches

I think the above idea would work, and be much lighter to implement than the current taxonomy_access.module
It would still need the taxonomy.module patch in order to not return taxonomies that a user role should not be seeing.

I don't see the need to store view/create/update permissions for every node. Which is what it looks like taxonomy_access.module is doing everytime a node is touched (through the taxonomy_access_nodeapi() call).

Nodelist : user error: Unknown column 'list' in 'where clause'

Hi,

I'm using Drupal 463.

I installed nodelist 4.6.0.

I can list the content, but anytime I access to node/list by doing : http://drupal/mysite/?q=node/list
this error message displayed:

user error: Unknown column 'list' in 'where clause'
query: SELECT MIN(created) AS created, MAX(created) AS max_created from node WHERE status = 1 AND uid = list in /var/www/drupal/mysite/includes/database.mysql.inc on line 66.

Thanks for your help.

Mermaid

user homepage

would the following module be any use to people?

A module that allow users to specify any page on the site to be their homepage. So that when they first login, or they click the home link in the breadcrumbs that's where they are taken.

I wanted to go directly to a different page to everyone else when I first logged in. I thought this would be the best way of doing it.

I've got the basics up and running on test.xai-corp.net

Events Module - time/date problem

I installed the Events module, and all of my events are showing up with a Start time of 12/31/1969 - 5:00pm, irregardless of the actual Start time specified in the content. What am I missing?

new location field in event module

My post deals with a slight problem that I'm having with inserting. I am expanding the event module to include a location field. The event module utilizes nodeapi. When I put all of the fields in and hit preview, it looks fine, which tells me that during the node instance of preview the $node->location is set, but it never inserts it into the database, so it does not actually come up when users view it. My event table has the following fields

int(10) start
int(10) end
int(10) tz //timezone
int(10) nid
varchar(20) location

Here's a quick rundown of the important code:

//First I have a form textarea for the location
function event_nodeapi(&$node, $op, $arg = 0) {
switch ($op) {
...
case 'form post':
$form = '';
if (variable_get('event_nodeapi_'. $node->type, 'never') != 'never') {
global $user;
$form .= form_textarea(t('Location:'), 'location', $node->location, 30, 20, '', NULL, FALSE);
}
}
return $form;
...
//Then I have my insert function.
case 'insert':
if (variable_get('event_nodeapi_'. $node->type, 'never') != 'never') {
$fields = array('nid', 'start', 'end', 'location');
db_query('INSERT INTO {event} (nid, start, end, tz, location) VALUES (%d, %d, %d, %d, %s)', $node->nid, $node->start, $node->end, $node->tz, $node->location);
}
event_set_range();
break;

Removing core modules

Is it safe to remove core modules (e.g. blog, profile, forum, taxonomy, story, comment...) all together from the modules directory? I don't want any module I'm not using at the moment to be visible on the module administration page. Or are certain modules required to be present, even if they are not used?

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions