[Vtigercrm-developers] non-static Vtiger_Link handlers

Adam Heinz amh at metricwise.net
Tue Jul 9 20:20:22 UTC 2013


I use Vtiger_Link a ton these days now that I have context menus, so I
found myself wanting to use inheritance to set up my link handler
classes.  Unfortunately, the existing code only made static calls, so
I did away with that!  I changed all our custom code to be non-static,
but it still seems to  work for stock ModTracker even though I have
left that static method alone.


Index: html/vtlib/Vtiger/Link.php
===================================================================
--- html/vtlib/Vtiger/Link.php	(revision 4175)
+++ html/vtlib/Vtiger/Link.php	(revision 4451)
@@ -226,5 +226,6 @@
 				require_once $row['handler_path'];
 				$linkData = new Vtiger_LinkData($instance, $current_user);
-				$ignore = call_user_func(array($row['handler_class'],
$row['handler']), $linkData);
+				$handler_obj = new $row['handler_class'];
+				$ignore = call_user_func(array($handler_obj, $row['handler']), $linkData);
 				if(!$ignore) {
 					self::log("Ignoring Link ... ".var_export($row, true));
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20130709/d4b19f18/attachment.html>


More information about the vtigercrm-developers mailing list