I am using the Biblio module and need to differentiate between refereed and non-refereed articles.

I see there are custom fields and tried using custom 1; however, it allows anything to be input. Should I hack the code to make it a select list?

What do you recommend as the best way to provide a refereed / non-refereed designation on each article?

bekasu

CommentFileSizeAuthor
#19 patch_20varchar.txt16.21 KBbekasu
#18 biblio_refereed_1.patch19.76 KBbekasu

Comments

rjerome’s picture

What about using taxonomy?

bekasu’s picture

I'll look into it.

I'll let you know what works best when I get it resolved.

bekasu

rjerome’s picture

I think it should work. You could just create a "Designation" vocabulary and assign it to biblio the create the terms "refereed" and "non-refereed", make sure that in the settings for the vocabulary, "Tags" and "Multi-Select" are not selected and "Required" as desired. Then this vocabulary should show up on the input form for Biblio and allow you to choose either refereed or non-refereed.

You can subsequently filter on these values using the termID.

Cheers,

Ron.

bekasu’s picture

Since it looked like the Dallas Cowboys would do well in their game, I spent most of the game adding a new variable to biblio. Learned a lot.

Refereed Designation. I'm sure it could stand some improvement, but it appears to work for me.

If you are interested, let me know.

I did go down the vocabulary road, but found I would have to go back and change the info box so I could lose the hardcoded word vocabulary, and then the word biblio. Since I'd have to muck things up anyway, I took a swing at adding it to biblio for now.

bekasu

rjerome’s picture

Sure post or send me a patch and I'll take a look.

Ron.

bekasu’s picture

Ron,

I have the code working on my laptop.

I'm now stepping back to a fresh install of biblio's stable version and trying an upgrade to be sure the install/upgrade works.

Soon as I have everything wonderful, I'll put the patch up.

bekasu

rjerome’s picture

Hey, according to my inbox there used to be a patch here... Where did it go???

You picked a particularly nasty bit of the code for your first attempt at a patch :-) You see that input form is built almost entirely on the fly from the database so the code is probably almost incomprehensible to the uninitiated.

Good luck, and don't worry all contributions are welcome.

BTW, I too do my coding on Windoze with an Apache 2.2 server, but my production servers are Linux.

Ron.

bekasu’s picture

Ron...

I have the code working if it is a fresh install.

On an upgrade, I have 2 of the 4 tables correctly changed. Biblio gets a new field and biblio_fields gets a new entry.

However, I need your guidance on how to update the biblio_field_type and biblio_field_type_data tables.

I was going to drop the tables and then read the csv files again with a table reload. But I don't want to lose any updates that might have occurred prior to this update. I'm not familiar enough with biblio to know if these two tables (biblio_field_type and biblio_field type_data) can be updated by some other method than unloading and reloading the csv files.

How do you want me to handle pulling in the csv file updates?

bekasu

rjerome’s picture

Hi Bekasu,

You wouldn't want to drop those tables and recreate them, since the user may have made changes, additions via the GUI (which would be lost), so you will have to apply any additions you made to the CVS files to the DB manually via INSERT or UPDATE queries.

Ron.

bekasu’s picture

Will do..

Sorry about the patch tease. I tested it, posted it and then gasped as I realized I hadn't tested an upgrade - only a fresh install.

I'll insert the column to the table and a generic entry into the data table.

I agree about the code ... blew my mind.

I appreciate the guidance on the tables, my gut was telling me to tread lightly.

bekasu

bekasu’s picture

Ron,

I was writing the code tonight to read the existing biblio_field_type table.

I researched the correct way to write drupal inserts and found that db_query(INSERT is not recommended any longer.
It now says we are supposed to use drupal_write_record.

However, all the biblio entries in the install module use INSERT.

Do you want me to start using drupal_write_record or continue using INSERT?

I don't want to muck up any conversion you have in mind.

bekasu

rjerome’s picture

Yes, well there is a reason for that... and if I recall correctly there is a chicken and egg scenario with the .install file. drupal_write_record requires the schema API to be initialized however the schema API is initialized FROM the .install file and therefore not available for use within the .install file :-( This is also why you see calls to biblio_schema within the .install file since you can't use the regular API functions to access the schema during install.

You could possibly get away with it for updates, but if the schema has also changed during that update you could be in trouble.

Ron.

bekasu’s picture

No problem.

I'll continue with the INSERT method previously used.

I didn't want to co-mingle two processes and cause you more grief.

bekasu

bekasu’s picture

Ron,

Don't want u 2 think i deserted u.
I accidently smashed 4 fingers on my left hand.. thumb is ok.

I just got feeling back in my pinkie today. Hope 2 be back coding within a week.

Never realized how much you need a left hand to type.

It goees soo slowly with hunt and peck.

bekasu

rjerome’s picture

Oh no, that's terrible! Hope your feeling better soon. I can relate though, I cut off two of the fingers on my right hand a while back. They put them back on, and for the most part they are functional now, but it took a while.

Ron.

bekasu’s picture

turns out the middle finger of my left hand has a broken bone between middle joint and end of thre finger .. orthopedtrics appt this nect week. takes a while for stuff when you live as rural as i do.

oh my gawd .. 2 fingers reattached... wow
thanks for the encouragemrnt.

bekasu

bekasu’s picture

StatusFileSize
new19.76 KB

Here is my official first attempt at 1) using eclipse & 2) creating a patch

Please let me know what i need to correct ;)

Especially if I should be creating the code in a different directory or something.

bekasu’s picture

StatusFileSize
new16.21 KB

Here is my official - 2nd try . Corrects the branch used and makes the variable definition consistent.

bekasu

bekasu’s picture

Status: Active » Fixed

Marking the issue fixed.
Patch was accepted and after a little TLC, incorporated into Biblio.

Thanks Larry Ron..
Bekasu

Status: Fixed » Closed (fixed)

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