The current 6.x-1.0 version of Freelinking doesn't play nicely with Drupal 6.0 RC1. This is due to several changes that've happened since the beta versions of Drupal 6. The APIs and function calls for Drupal are relatively stable now, so hopefully changes won't need to be made much later to Freelinking for it to work with the gold master of 6.0. I've marked this critical as the 6.x branch of this module doesn't work with 6.0, even though it should.
I need this for a website I'm working on, so I took it upon myself to fix Freelinking up for the 6.0 release. I think there're still a few bugs, and I'll squash them when I find them, but it currently works, which could not be said about 1.0.
Besides the info in the patch, the freelinking.schema file can be deleted as that info is now contained in the .install file.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | freelinking.patch | 29.79 KB | Susurrus |
| #5 | freelinking.patch | 26.51 KB | Susurrus |
| #2 | freelinking.patch | 24.83 KB | Susurrus |
| #1 | freelinking.patch | 15.51 KB | Susurrus |
| freelinking.patch | 7.32 KB | Susurrus |
Comments
Comment #1
Susurrus commentedOkay, I've worked some more on this patch and this patch includes some coding fixes (recommended by coder.module), some optimizations (bye-bye hash and args), and as well as some bug fixes (deleted nodes are reset as lacking a node, change to the default node type correctly affects missing freelinks shown in block).
Comment #2
Susurrus commentedI've made further improvements here. External links are now correctly classed as such as well as freelinks that don't exist yet are now classed as nonexistent. The database now stores which nodes a freelink is referenced in, which allows links to be found quickly for nodes (and is how the nonexistent class is applied with minimal overhead). A lot of the code was refactored into better organized methods and _freelinking_find_freelinks() now returns a nice array which is documented in the code. Everything should be working correctly unlike in the last release.
Comment #3
Susurrus commentedI'd like to see what anyone's thoughts are on this code. I shouldn't've said it was ready to be committed, as that's the maintainers job.
Comment #4
eafarris commentedThere is some good work being done in this patch, but we're not there yet:
_freelinking_update_in_nodes(), but the new function is not defined in the patch.nod->nidshould benode->nidin_freelinking_exists()freelinking_page()was changed to SELECT a non-existent column, nid,Comment #5
Susurrus commentedI fixed everything you suggested. The issue with the non-existent column, nid, was because I changed freelinking to use nids instead of paths. Since the path would only ever point to non-existent content or valid nodes, nid would save a significant amount of space. External links are also no longer stored in the database, so storing them is a non-issue. It seems that I was partway through this conversion when I made that patch, whoops.
This code also now removes freelinks that aren't contained in any nodes and includes proper indices in the DB that should speed things up for large sites. hook_uninstall() was also changed to remove all variables set by the freelinking module.
As for the in_nodes text-area, that's been deleted and replaced with a new table, freelinking_node_rel. The only issue with this data structure is now there're two tables with the same columns, but the freelinking table has a 1-to-1 relationship and the freelinking_node_rel table has a 1-to-many relationship. It can be hard to keep this straight (at least for me when I was creating it), but hopefully it's well-enough documented.
Comment #6
Susurrus commentedComment #7
eafarris commentedGetting very close now.
db_add_index()(missing an argument). See the definition at Drupal API.INSERT INTOsql not correct in_freelinking_update_freelinks()when multiple freelinks exist within one nodeThanks very much for your efforts here.
Comment #8
Susurrus commentedOkay, well, I've fixed all of the problems you talked about with the exception of importing old data. It seems like the easiest way to update the freelinks is to just go through all nodes that should be a part of the freelinking network and redo all of the freelinks. I had been just updating the freelinking nodes, but with freelinking_node_rel existing, the update process needs to populate this table. This requires exploring every node.
Since this is required and there's an existing function for populating both tables, I've decided just to drop the old table and create the new ones. Every node will just have to be processed. It should probably use the Batch API (if this exists for update functions) or some other method as for a site like Wikipedia, you wouldn't be able to re-freelink the entire site in 30s.
Also, how does this module work in regards to revisions or should? Currently I'm not sure how revisions are handled by this module as I've never tested that functionality, but I'm not sure if or how they should be.
Comment #9
Susurrus commentedThe only issue that I still see with this is how the block functions with no freelink content. I think It should not display if there's no content.
Comment #10
relaxnow@groups.drupal.org commentedAny hints on how to apply this patch for us newbies? When I click on it, it just opens in the browser.
Comment #11
Susurrus commentedThere's some good documentation on this in the Drupal handbooks: http://drupal.org/patch/apply
Comment #12
robbt commentedWhen I used this patch, other than it not working with the upgrade in terms of losing the data. I also found that CamelCase wiki words had the first part of them stripped out, so CamelCase would show up as just Case when displayed and link to Case vs. CamelCase as it is supposed to. [[Works]] just fine though.
Comment #13
eafarris commentedI am able to install and use the module on Drupal 6.1 without this patch. Is this still an issue?
Comment #14
robbt commentedThis module doesn't appear to be maintained at the moment. The above patch made the module not work for me, so I'd suggest not utilizing it.
Comment #15
eafarris commentedFreelinking module version 6.x-1.2 appears to work properly in a new installation of Drupal 6.1.
Comment #16
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.