In order to make things cleaner and easier, my small handful of plugins run on both EE1 and EE2. This is handled with a standard bit of code at the beginning of each one:
// Are we running EE 1.x or 2.x?
global $TMPL, $DB, $REGX;
$version = "";
if ( $TMPL )
{
$version = "1";
}
else
{
$version = "2";
}
if ($version == "2")
{
$this->EE =& get_instance();
$TMPL = $this->EE->TMPL;
$DB = $this->EE->db;
$REGX = $this->EE->security;
}Okay, so it’s not exactly the Solspace Bridge, but it does work. At least, for some plugins, in some circumstances. My problem is that in one plugin, Tied Entries, in some circumstances, it doesn’t work.
The problem showed up when using the plugin to help with some relatively complex relationship handling. It’s called in an embedded template (#1), and called again within a further embedded template (#2) within an channel:entries tag. The plugin works within template #1 but only works once within template #2; in subsequent loops through the channel:entries tag the plugin doesn’t work. Some elementary debugging suggests that it doesn’t seem to accept the
$this->EE =& get_instance();declaration.
The plugin is using
require_once PATH_MOD.'channel/mod.channel'.EXT;and I’m wondering if that could be the problem?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.