Menu

Search error in mobile 4.0b4 when not logged-in

Help
2013-11-10
2013-12-01
  • Elwin Nieuwenhuis

    Hello,

    With the mobile version 4.0 beta 4 I get the following error when I search for a particular keyword:

    Fatal error: Call to a member function RecordCount() on a non-object in xxx\modules\recipes\search_mob.php on line 44.

    I found out that the cause is when there's no user_id returned from the function $SMObj->getUserID(). That happens when you are not logged in. When you are logged in everything works fine.

    I quickly made the following workaround:
    if ($SMObj->getUserID()) {
    $query = $query_all . " WHERE recipe_user = " . $SMObj->getUserID() . " AND ";
    } else {
    $query = $query_all . " WHERE recipe_user = " . "12" . " AND ";
    }

    User_id '12' is the only user yet, so in this case it works fine (for a while).
    But in my opinion you have to search all non-private recipes when you are not logged in. The workaround don't give a solution for this.

    WIll you fix this bug?

    Thanks in advance.

    Regards,

    Elwin

     

    Last edit: Elwin Nieuwenhuis 2013-11-11
  • Todd Rogers

    Todd Rogers - 2013-12-01

    Yes, will be fixed in 4.01 release.

    I had the correct logic in the more advanced regular site search but not simplified mobile version. It will search on non-private recipes after the fix.

     

Log in to post a comment.