Download & Extend

Undefined function weblinks_goto and time function error

Project:Web Links
Version:5.x-2.4
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi

That must be about one of the fastest bug patches in history. :)

I'm doing a custom insert weblinks category input filter tag and I think I may be working off the beaten track a bit. Anyway, I used the menu link 'weblinks/goto/3643', and got the following error:

Call to undefined function "_weblinks_goto",

I fixed this to "weblinks_goto" and got error "Function name must be a string" from the use of $time()

Anyways, heres the patch

<?php
### Eclipse Workspace Patch 1.0
#P vettest
Index: sites/all/modules/weblinks/weblinks.module
===================================================================
---
sites/all/modules/weblinks/weblinks.module    (revision 2004)
+++
sites/all/modules/weblinks/weblinks.module    (working copy)
@@ -
1433,7 +1433,7 @@

  
// Handle 'weblinks/goto/nid'.
  
if ($tid === 'goto') {
-    return
_weblinks_goto(arg(2));
+    return
weblinks_goto(arg(2));
   }

  
// Get the page description, if there is one.
@@ -1642,7 +1642,7 @@
  */
function
weblinks_goto($nid) {
  
$node = node_load($nid);
$qargs = array($time(), $node->nid, $node->vid);
$qargs = array(time(), $node->nid, $node->vid);
  
db_query("UPDATE {weblinks} SET click_count=click_count+1, last_click=%d WHERE nid=%d AND vid=%d", $qargs);
   if (
module_exists('statistics')) {
    
statistics_exit('node', $node->nid, '');

?>

Cheers

Comments

#1

Version:5.x-2.3» 5.x-2.4

Sorry, forgot to flag the version correctly after recreating the patch

#2

When I added click tracking to 6.x-2.x, I found that $time() problem and fixed it there. I don't know if this is a complete fix, but it must work for you.

#3

Alan D,

It looks like you are looking to do what we did in 6.x already. There are a few links on the bottom of this issue. that will show you what was changed in 6.x

#421666: redirect

Thanks
Robert

#4

I get the feeling that I'm on a limb here, triggering the version 6 api from version 5. It is a drupal five site that can not be updated, (custom integrated multisite with 30 or so sites hanging off a shared database with 15+ non-ported version 5 modules)

I will let you know how things go...

#5

Alan D.,

That Sucks. I have 1 site left on 5 that I am tiring to get upgraded to 6. I am lucky I only have 1 Module left.

Thanks
Robert

#6

I think that we are supporting 3 four sites and about 60 five sites, so I'm use to switching between versions ;)

After the above changes, the new filter was working sweetly. I didn't need the click counts, so I can not comment on the stats side of things.

I've still got a couple hours work left, and I'll post back the code when finished. It may be useful, but it was fairly custom for the site, not using stored variable config., custom query to implement the standard Drupal pager, etc. The tag was [weblinks:category tid]

Cheers
Alan

#7

With no other complaints, I think we can close this.

#8

Status:active» closed (fixed)