This forum is for less technical discussions about the Drupal project, not for support questions.

plpgsql dynamic record access help

Hello,
Sorry for posting this in general section. I have searched everywere for a solution pls help me. I am building a trigger which would keep track of every modification to some table. here i am generlising the function. the following is the code in plpgsql.

--/* function for giving the field attributes of a given table */
CREATE FUNCTION get_fld_name(text) RETURNS _varchar AS '
DECLARE
out_fld text[20] := array[''name'',''no''];

BEGIN
RETURN out_fld;
END;
' LANGUAGE 'plpgsql';

--/** function for recording the changes **/

CREATE FUNCTION my_func_test() RETURNS OPAQUE AS '
DECLARE

flds text[20];
fldname text;

ofld text;
nfld text;

BEGIN

flds := (SELECT * from get_fld_name(TG_RELNAME));
IF TG_OP=''INSERT'' THEN
ofld=nfld;
END IF;
FOR i IN 1..20 loop
IF flds[i] <> ''NULL'' THEN
fldname := flds[i];

--/**************** Here is the problem ****************/

ofld := OLD.fldname; -- this should return Old's value
nfld := NEW.fldname; -- this should return New's value

--/****I want to get he value from OLD.name or OLD.No *******/

--/***********************************************************

Is there any way to concatnate the 2 Objects [(OLD) and (Fldname) ] so that fldname would be converted to the value but the object OLD remains same.

***********************************************************/

Developers, how do you organize/manage your files? (handbook questionairre)

the goal of this post is to address one of the areas that i haven't found any supporting documentation for, with the final goal of adding a section to the handbook so that others who follow me won't be faced w/ the same confusion... :) i'm also hoping that those who post here may also learn some things from other people taking a different approach. so, here's the question:

as a developer (and probably an admin of drupal sites as well), how do you organize and manage your files? i know that's a pretty general question, so i'll start with my answer as an example of exactly what i'm talking about:

i've got cvs installed and working, and at the moment i have cvs versions of drupal HEAD, drupal 4.6, contributions HEAD, and contributions 4.6 on my local machine. from time to time i'll run the cvs update command manually on each one to make sure i have the latest updates. if i want to create a patch, then i'll make my modifications in a copy of the file that i got from my latest cvs update, and make a diff against the vanilla file. then submit the patch, wait until it gets committed, and then run cvs update again to get the 'official' patched file. if i want to submit multiple patches to the same file, at this point i feel that i need to wait until the first patch gets committed (since i don't have commit privs yet) before i write and submit the second patch. for any drupal sites that i'm maintaining, at this point i really don't have any system for getting any of the updates i get on my local cvs copy onto the website. i suppose one way would be to just ftp the cvs version i have on my local machine to the website and overwrite the existing files there. it would be great if i could run a cvs update command directly on the files on my webserver, but i don't think i can do that. at this point i don't have any scripts to automate any of this stuff, nor do i know how helpful they would be...

group control for blocks?

i've been looking around, but it appears there's no interface to manage group/role access to a block on the site?

so then if i enable a block, and it doesn't have built-in detection to turn off if the user is not an admin, i'm displaying that content fully publicly? or am i missing a setting?

just wondering. i'd be surprised if drupal didn't allow for permission settings on blocks, since everything else seems fine-grained

RTFM?

Is there any way that we could deal with newbies not reading the handbook at all and asking just plain obvious questions that are right there in the handbook. Should we have a general policy of ignoring these posts, answering them, or pointing people to the handbook as much as possible? I think having a general spirit of encouraging users to use the handbook and consolidating as much information as possible is the way to go. Currently drupal.org is getting littered with tons of unnecessary repeated content which is not good, at least not in my opinion.

Is it possible to use tables as building blocks in drupal?

I have installed Drupal and have been looking through the Drupal website but I can not find one particular feature I'm very interested in: using tables as building blocks. I don't mean HTML tables, but database tables. That is, tables that you can edit, sort and filter and maybe relate to other tables. It would be nice if there was a friendly user interface for creating a table, editing data, sorting and filtering. Tables like this could be used for all kinds of purposes, like task lists, inventory lists, etc.

Theme Drive?

I'm an professional web developer and apprentice graphic designer. I earn my living a site running on another CMS and I am looking to launch a brand new site with Drupal.

One of the problems I am finding is that there are very few drupal themes out there. I don't have the time or energy to design a theme from scratch, and I would perfer to tweek an exisiting theme for my purposes.

Pages

Subscribe with RSS Subscribe to RSS - General discussion