having issues doing the classic element type query, works fine with numerical criteria (id, price etc.) but fails on strings, (code, name etc.). It just returns all elements.
$criteria = craft()->elements->getCriteria('GoWander_Trip');
$criteria->code = $code;
return $criteria->find();
Is there any step im missing in the setup of the element itself (code below)?
public function modifyElementsQuery(DbCommand $query, ElementCriteriaModel $criteria) {
$query
->addSelect('
trips.code,
trips.templateId,
trips.start,
trips.end,
trips.assetId,
trips.price,
trips.spots,
trips.spotsAvailable,
trips.elements,
trips.shortDescription
')
->join('gowander_trips trips', 'trips.id = elements.id');
if ($criteria->templateId) {
$query->andWhere(DbHelper::parseParam('trips.templateId', $criteria->templateId, $query->params));
}
}