Attached is a patch that updates links_related.module to work with the latest head. The nodeapi 'settings' $op has been replaced by the more general hook_form_alter.

In addition, the ugly html hacking I did in the nodeapi form $op to create the related links table is gone. Proper forms api theming is now used to make the table, allowing themes to override it if necessary.

the settings checkbox still appears in a strange place on the node-type specific config pages, but this appears to be a problem in node module rather than links_related. Still investigating.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

syscrusher’s picture

Hi, Eaton!

I took a quick look at your patch...some good changes!

I have a question, though. I notice you made changes to some code in a function where I had __SAVE__ in the name. That was a deprecated function that I simply hadn't removed yet because I was still referring back to it to see "how I had done things before." Your code doesn't depend on that function, does it? If not, I'll go ahead and commit the patch and then delete that old function afterward, and we'll be fine.

I may have further questions as I test the patch, but at first glance, it looks like a keeper.

Thanks for the contrib!

Scott

syscrusher’s picture

Assigned: Unassigned » syscrusher
syscrusher’s picture

Status: Needs review » Fixed

Never mind...answered my own question. Good patch, and it's committed to CVS now. :-)

Eaton, thanks much for your excellent work.

Scott

eaton’s picture

Title: links_related: nodapi settings -> form_alter » links.module: nodapi form -> form_alter
Status: Fixed » Needs review
FileSize
3.49 KB

Keeping up with the joneses. both links_related and links_weblink used nodeapi form, this has been moved to hook_form_alter.

eaton’s picture

annnnd the links_related_weblink portion.

drewish’s picture

I guess you hadn't looked at my patch for the weblinks module: http://drupal.org/node/40077
It could have saved you a little trouble ;) I'd made the form change, fixed the base name in links_weblink_node_info(), and dropped links_weblink_node_name() because it's not used in 4.7.

I've attached an updated patch for links_related.module. It cleans up the logic of links_related_form_alter(), (though it maybe a bit too agressive, let me know if you think there's a problem) and fixes a bug where you'd used $node but it hadn't been assigned. The patch also removes some dead code in _links_related_form_line(). The index parameter looked like it was left over from some table coloring code.

eaton’s picture

Oh, sweet. I hadn't spotted that -- just had some time off work and did the updating with the latest CVS version. It appears your patch is definitely more comprehensive. :)

syscrusher’s picture

Patches applied to both modules. Please grab CVS HEAD version and check to make sure I applied your patches in the correct order and got the right version of each. Thanks!

Scott