juuser
Well-Known Member
Hello,
I have two php plugins in one form (onAfterProcess) and they both submit fine when used separately (one disabled), but when both are enabled they are not working.
What could cause this?
First plugin:
Second plugin code:
Thanks
I have two php plugins in one form (onAfterProcess) and they both submit fine when used separately (one disabled), but when both are enabled they are not working.
What could cause this?
First plugin:
Code:
$db3 = JFactory::getDbo();
$query3 = $db3->getQuery(true);
$db3->setQuery( "SELECT MAX(a.lisatud_muudetud) FROM plastone_tooted_vormid_seadist_sissekanded AS a LEFT JOIN plastone_tooted_vormiremont AS b ON a.vormi_id=b.vormi_id WHERE b.vormi_id = '{plastone_tooted_vormiremont___vormi_id}' " );
$tulemus3 = $db3->loadResult();
$db1 = JFactory::getDbo();
$query1 = $db1->getQuery(true);
$db1->setQuery( "SELECT MAX(kande_kuupaev) FROM plastone_tooted_vormiremont AS a WHERE a.vormi_id = '{plastone_tooted_vormiremont___vormi_id}' " );
$tulemus1 = $db1->loadResult();
$db2 = JFactory::getDbo();
$query2 = $db2->getQuery(true);
$db2->setQuery( "SELECT kande_kuupaev FROM plastone_tooted_vormiremont AS a WHERE a.id = '{rowid}' " );
$tulemus2 = $db2->loadResult();
if ($tulemus2 > $tulemus3) {
if ($tulemus1 == $tulemus2) {
$vormkorras = '{plastone_tooted_vormiremont___tagasi_kuupaev}';
if ($vormkorras == '')
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$db->setQuery( "UPDATE plastone_tooted_vormid AS a LEFT JOIN plastone_tooted_vormiremont AS b ON a.id=b.vormi_id SET hooldusstaatus='4' WHERE a.id = '{plastone_tooted_vormiremont___vormi_id_raw}' " );
return $db->loadResult();
} else {
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$db->setQuery( "UPDATE plastone_tooted_vormid AS a LEFT JOIN plastone_tooted_vormiremont AS b ON a.id=b.vormi_id SET hooldusstaatus='0' WHERE a.id = '{plastone_tooted_vormiremont___vormi_id_raw}' " );
return $db->loadResult();
}
}
}
Second plugin code:
Code:
$tulemus11 = "R";
$tulemus11 .= "{plastone_tooted_vormiremont___id_raw}";
$db7 = JFactory::getDbo();
$query7 = $db7->getQuery(true);
$db7->setQuery( "UPDATE plastone_tooted_vormiremont AS a SET t66_id_nr='$tulemus11' WHERE a.id = '{plastone_tooted_vormiremont___id_raw}' " );
return $db7->loadResult();
Thanks