If I hardwire an sql custom field, the query works as it should (for this specific userid, 305): SELECT id AS value, title AS text FROM #__content where catid = 8 and created_by = 305 What I want to do is allow the created_by clause to be dynamic : Substituted with JFactory::getUser()->id; I figured if […]
Categories
Altering the SQL custom field
- Post author By Ask Me
- Post date March 24, 2020
- No Comments on Altering the SQL custom field
- Tags ', ''); if (substr_count($value, "%%userid%%") > 0){ $userid = JFactory::getUser()->id; str_replace("%%userid%%", ); Ideally, $query); } // Run the query with a having condition because it supports aliases $db->setQuery($query . ' having value in (' . trim($conditio, 305): SELECT id AS value, and be happy to donate it to the world! I'm not even having much fun in trying to debug this ! Thanks for any suggestions. Be safe ! Bria, but I'm not having too much luck. In plugins/fields/sql/tmpl/sql.php I have: $query = $fieldParams->get('query', I would create a brand new custom field, If I hardwire an sql custom field, the query works as it should (for this specific userid, title AS text FROM #__content where catid = 8 and created_by = %%userid%% I could replace the %%userid%% with a dynamic number before the qu, title AS text FROM #__content where catid = 8 and created_by = 305 What I want to do is allow the created_by clause to be dynamic : Substitu, USERID