When a Freelink is created in a node (with [[]] or CamelCase) the link appears in: http://mysite.com/freelinking
Problem is that when the node or the Freelink in the node is deleted the freelink remains in the Freelinks list.

What would be nice to have is a 'delete' button to get rid of these links.

Comments

stevryn’s picture

Yeah I thought that was kind of odd that you cant delete a freelink from the table. It seems like this wouldn't be too difficult to add to that overview page.

awgrover’s picture

Also, if you make a typo, you get an entry that haunts you forever.

To automatically clean up the list (delete freelinks that aren't _from_ somewhere), we'd have to search all content. Is that even doable? We'd have to look inside CCK, new node-types, etc. Yech.

eafarris’s picture

The only purpose the freelinking table serves is to display that list, so it's safe to just delete all content from that table ("DELETE FROM freelinking") from time to time. The page will get re-populated as freelinks are followed.

It would be difficult to keep that table up to date as content changes, without some serious restructuring of the module (which I'm not opposed to).

However, a simple delete function to remove one record from the table should be a pretty easy patch.

zeroyon’s picture

I agree I think its pretty silly that you can't "As an Admin" selectively delete items from the freelink table.. You would think that during the course of design this would have be a "No brainer".. If a revision could be made that let's you select terms from the freelink table and push delete, without having to run queries on the database that would be good...

spiderman’s picture

Assigned: Unassigned » spiderman
Status: Active » Needs review
StatusFileSize
new7.36 KB

Just ran across this issue recently, and have rolled the following patch this morning. I've basically stolen the technique used on the admin/content/node page, found in node.module in the function node_admin_nodes and friends. I've added in a pager and tablesort feature (see #192263) as a bonus.

NB: There is probably a security issue in the way I've done the _submit hook for the new freelinking_page_form, since it doesn't doublecheck permissions at this point. Presumably someone could post the form through some other means (bypassing the security around the form rendering code) and sneak delete operations in nefariously, yes? Would a simple user_access("administer freelinking") check surrounding the entire submit hook suffice? Would we also need this in the freelinking_multiple_delete_confirm_submit hook?

spiderman’s picture

I noticed that the tableselect checkbox only selects the currently visible links, so I've added a "delete-all" operation which allows the admin to remove ALL freelink entries.

spiderman’s picture

a fresh version with a fix of the 'suffic' typo in the options fieldset form element.

spiderman’s picture

Also just noticed that I'd lied about the tablesort feature above, so rolled that in, too :)

spiffyd’s picture

@#8 this patch is against which module version? it'll also be nice if u can attach the attached mod directory in a zip :)

and this is for 5.x correct? won't work for 6.x?

spiderman’s picture

sorry, i should've rolled the patch against a CVS checkout, but yes, it's for DRUPAL-5 (latest -dev tarball or 5.x-1.3-beta2 should be fine) and won't work against 6.x (tho porting it is probably relatively straightforward, i don't have time or inclination, atm)

eafarris’s picture

Status: Needs review » Fixed

Implemented as part of freelinking-5.x-1.4. Thanks for the excellent patch, spiderman! Very well done.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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