find_one methods: include unpublished if logged-in

edited April 2012 in Bug Reports
How can you force the find_one (or even find_all) methods to also include unpublished (ie published = 'no') entries? This should be by default if the user is 'fueliefied' in my opinion...
I tried even forcing the published = no in the where condition of find_one but to no avail... what to do?

Comments

  • edited April 2012
    Try writing your own _common_query() method even if empty. Your where clause should work then.

    I usually do:

    If ( ! fuelified()) $where = array('published' => 'yes');

    That might be is_fuelified(), I forget..
  • edited 9:50AM
    that totally did the trick


    function _common_query() {

    if ( !is_fuelified()) $this->db->where(array('published' => 'yes'));

    }
    thanks!
  • edited 9:50AM
    No problem, happy you got it sorted!
Sign In or Register to comment.