I want to add another field to Weblinks. IN a day an age of blogging and aggregators, weblinks isn't all that useful without an additional synidiation link field I'll call 'xml' (or RSS or Atom depending on how you want to name it).

I need to know where in the code I would add the text field 'xml' to the node in weblink.module so I could dereference it as $node->xml the same as I would $node-url.

Meaning, the re-write rocks, but it is a bit cryptic now and I need a bit of a shove in the right direction to add this field.

Comments

MeanDean’s picture

Well I can get it to display data from the new field, so I'm populating the node correctly at last at one point.

Now the trouble, though I get the new field to show up on the content form, I can't get it to save the data even though I've modified the SQL correctly (hand tested and everything).

I'm missing something after the postback.

MeanDean’s picture

Category: support » bug

It's not just me ... original version is _not_ updating the url correctly:

function weblink_update($node) {
db_query("UPDATE {weblinks} SET url = '%s', url_md5 = '%s' WHERE lid = '%d'", $node->url, md5($node->url), $node->lid);
}

Looks like value for $node->lid is either null or perhaps a copy of $none-nid -- which sometimes isn't always the same.

MeanDean’s picture

my fix:

function weblink_form(&$node, &$param) {
$output .= form_hidden('lid', $node->lid);

...

Now for the religious question, should weblink use the $node->nid instead of its own unique $node-lid?

Bèr Kessels’s picture

No, weblinks should NOT use nid or lid. unfortunately the other modules for weblinks are STILL not released, allthough they promised me to do so over a month ago.
These modules use the same table.

Bèr Kessels’s picture

Status: Active » Closed (won't fix)

the links bundle has this.