davez
Member
I'm setting up a PayPal Subscription for the first time and am troubleshooting via the Fabrik Log. I end up getting a functional query that pulls the correct data from my subscriptions table. But when I debug editing the plugins/fabrik_form/paypal/scripts/paypal.php file, I'm finding that the query is still outputting null for the subscription object.
So, even though I have a valid $query, I'm not getting an object out of $sub. I noticed the JModelLegacy at the top. Is this a legacy issue?
Code:
if ($this->isSubscription($params))
{
$subTable = JModelLegacy::getInstance('List', 'FabrikFEModel');
$subTable->setId((int) $params->get('paypal_subs_table'));
$idEl = FabrikString::safeColName($params->get('paypal_subs_id', ''));
$durationEl = FabrikString::safeColName($params->get('paypal_subs_duration', ''));
$durationPerEl = FabrikString::safeColName($params->get('paypal_subs_duration_period', ''));
$name = $params->get('paypal_subs_name', '');
$subDb = $subTable->getDb();
$query = $subDb->getQuery(true);
$query->select('*, ' . $durationEl . ' AS p3, ' . $durationPerEl . ' AS t3, ' . $subDb->q($itemRaw) . ' AS item_number')
->from($subTable->getTable()->db_table_name)
->where($idEl . ' = ' . $subDb->quote($itemRaw));
$subDb->setQuery($query);
// Log the query
$this->doLog('fabrik.paypal.onAfterProcess.debug', "Subscription query: " . (string) $query);
$sub = $subDb->loadObject();
if (is_object($sub))