Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#6 | links_related.module_2.patch | 4.05 KB | drewish |
#5 | links_weblink.module_0.patch | 1.35 KB | eaton |
#4 | links_related.module_1.patch | 3.49 KB | eaton |
links_related.module.patch | 6.13 KB | eaton |
Comments
Comment #1
syscrusher CreditAttribution: syscrusher commentedHi, 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
Comment #2
syscrusher CreditAttribution: syscrusher commentedComment #3
syscrusher CreditAttribution: syscrusher commentedNever mind...answered my own question. Good patch, and it's committed to CVS now. :-)
Eaton, thanks much for your excellent work.
Scott
Comment #4
eaton CreditAttribution: eaton commentedKeeping up with the joneses. both links_related and links_weblink used nodeapi form, this has been moved to hook_form_alter.
Comment #5
eaton CreditAttribution: eaton commentedannnnd the links_related_weblink portion.
Comment #6
drewish CreditAttribution: drewish commentedI 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.
Comment #7
eaton CreditAttribution: eaton commentedOh, 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. :)
Comment #8
syscrusher CreditAttribution: syscrusher commentedPatches 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