Update for Drupal 5

Freso - April 26, 2007 - 01:06
Project:FOAF
Version:5.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

Please update this module for Drupal 5.

#1

christopher_skauss - May 28, 2007 - 16:18

I second that request, Drupal needs FOAF!

#2

truecms.net.au - June 21, 2007 - 04:12

Hi. Drupal definitely needs this module. I would add here one important feature which could make this module priceless - to embed user permissions for browsing content, created by user, by FOAF - e.g. My Friends and Friends of a Friend could browse this content.

#3

B747 - August 21, 2007 - 19:42

Update for Drupal 5 needed!!!

#4

r0g1 - March 2, 2008 - 20:35
Title:Update for Drupal 5» Update for Drupal 6

By now....make that 6 (;

#5

Freso - March 3, 2008 - 16:34
Title:Update for Drupal 6» Update for Drupal 5

r0g1: Actually, there might still be people wanting a 5.x port, and D5 is still supported, so this issue is still valid as it is. I do agree, though, that I'd be more interested in a port for 6.x, and would definitely also subscribe to an issue for porting to that. :)

(If foaf.module is going to skip 5.x, then this issue should be marked "won't fix".)

#6

Wim Leers - March 8, 2008 - 15:46
Status:active» needs review

Here's one that works for Drupal 5. I did this in about 10 minutes, but it seems to be working nicely. I took the code from the 4.7 module (the code in CVS is only up to 4.6, there's an issue for 4.7 support) and started from that. No guarantees of course, but this should get you started.

AttachmentSize
foaf.zip 9.98 KB

#7

SamRose - March 8, 2008 - 15:52

It would be awesome one day to see a diff of what is changed between 4.7, 5.x, and 6.x modules. I would love to pitch in and help upgrade some modules, or patch and fix existing upgrades, and seeing these differences shown as a comparison of one file to another would really help me learn more than just looking at the handbook info about how to upgrade.

I suppose I could upload two versions of a module in a revision control and look at the differences there. Maybe I will go ahead and do that.... :-)

Anyway, just a sidebar thought. I will try and test out FOAF zip above, and thanks for contributing that!

#8

Wim Leers - March 8, 2008 - 18:52

Just check out this module from CVS, overwrite it with the files from the .zip and do a diff… ;) :)

#9

SamRose - March 8, 2008 - 22:53

(it worked, thanks!)

#10

Freso - March 9, 2008 - 01:25
Status:needs review» needs work

Using HEAD from CVS and the files from Wim Leers, I have made the attached patch.
A quick review:

  1. It shouldn't include ?> at the end (this is removed in the attached patch)
  2. Coding style is generally not the Drupal standards
  3. It would be nice to have a .install with an uninstall function, removing all the foaf* variables.

Otherwise, the patch looks like its forbear, and I will test it ASAP.

AttachmentSize
foaf.d5_port.patch 10.93 KB

#11

Freso - March 9, 2008 - 15:04
Status:needs work» needs review

Here's a revised patch. I've altered the foaf_export() in favour of readability, cleaned up a ton of code style failings (both from previous patch(es) and before), fixed some string functions that were introduced in 4.7 to replace PHP's native ones (remember that this module in its current state is for 4.6!), and added foaf_uninstall() which will clean up the variable table. I've also tested the module somewhat, and found that it works. Please test and review!

AttachmentSize
foaf.d5_port_and_cleanup.patch 33.67 KB

#12

Wim Leers - March 9, 2008 - 16:08

Excellent work! :) I'll try to get walkah's attention over here.

#13

scor - March 10, 2008 - 00:12

Thanks Wim Leers and Freso for dusting off this module :)
The RDF output doesn't validate. I corrected a double quote issue. Also, RDF shouldn't contain HTML tags inside property elements (<em> here).
The patch attached produces valid RDF/XML.

AttachmentSize
foaf.d5_2.patch 33.68 KB

#14

scor - March 10, 2008 - 08:27

why do we use iso-8859-1 here?
This patch changes the output encoding to Drupal native utf-8.

AttachmentSize
foaf.d5_3.patch 33.67 KB

#15

Freso - March 10, 2008 - 00:42

Good catch with the character set. :) Is it actually being sent as UTF-8 though (that would make the most sense, seeing how everything in Drupal is pretty much UTF-8 nowadays)? (Also, just wondering, where is/was the <em> you talk of? I can't seem to find it in my patch. :/)

#16

scor - March 10, 2008 - 09:09

the <em> was hidden in the way t() handles the variables, which should use @variable to output plain text.
I've added the encoding to the header Content-Type: application/rdf+xml; charset=utf-8 and used drupal_set_header() instead of header().

AttachmentSize
foaf.d5_4.patch 33.71 KB

#17

Wim Leers - March 10, 2008 - 09:18

I think this module is finally getting the attention it deserves! :) How about we all volunteer to co-maintain this module? That'll prevent it from dying again.

#18

Freso - March 10, 2008 - 11:41

@scor: Ah, yes. I did make a mental note on checking up on @foo compared to %foo (I can never remember which is which), but I guess I lost the note again. :/

@Wim Leers: Haha. I'm game. :)

#19

Kim Bach - March 27, 2008 - 14:44

Great, I needed that, and had begun looking into it. I'll try to help keeping this module compatible, it looked like it was mostly Forms related.

#20

John Morahan - June 16, 2008 - 15:31

The profile stuff worked but the buddylist stuff did not.

AttachmentSize
foaf-139257.patch 33.39 KB

#21

scor - March 22, 2009 - 01:27
Version:HEAD» 5.x-1.x-dev
Status:needs review» fixed

committed #20. thanks to all who helped! closing this issue. let's start new issues for Drupal 5 now that we have a branch for it.

#22

System Message - April 5, 2009 - 01:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.