Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
  • Register
Welcome to the Q&A for Question2Answer.

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

Bug - custom page with option "visible to anyone" not available for not logged users.

+5 votes

1. Create a custom page with option "visible to anyone" and put the link to the footer.
2. Click on the link - it works.
3. Then log out.
4. Click on the link -  "No privilege error".

Seems that despite the "anyone" option, there is still a verification for logged users.

EDIT: 
I noticed that my old custom sites work ok. And if I edit the site, then it gets the error.
So sth must be wrong with saving the site access variable.

Q2A version: 1.5
asked Dec 23, 2011 in Q2A Core by Krzysztof Kielce
retagged Dec 23, 2011 by Krzysztof Kielce
I can confirm this, having the same problem right now. Won't show "Anyone" custom page links to literally anyone.

1 Answer

+2 votes
 
Best answer

Something is causing the function qa_db_get_pending_result('navpages'); to return a value of -106 value for the "permit" field if it is 150:

  [6]=>
  array(9) {
    ["pageid"]=>
    string(1) "6"
    ["title"]=>
    string(3) "FAQ"
    ["flags"]=>
    string(1) "1"
    ["permit"]=>
    string(4) "-106"

    ["nav"]=>
    string(1) "M"
    ["tags"]=>
    string(3) "faq"
    ["position"]=>
    string(1) "1"
    ["heading"]=>
    NULL
    ["_order_"]=>
    int(2)
  }

Setting permit to NULL in the database brings the pages back:

  [5]=>
  array(9) {
    ["pageid"]=>
    string(1) "5"
    ["title"]=>
    string(4) "Wiki"
    ["flags"]=>
    string(1) "1"
    ["permit"]=>
    NULL

    ["nav"]=>
    string(1) "M"
    ["tags"]=>
    string(4) "wiki"
    ["position"]=>
    string(1) "2"
    ["heading"]=>
    NULL
    ["_order_"]=>
    int(1)
  }

UPDATE:

Still can't figure this one out, but it's something to do with the selectspec not loading.  Loading the selectspec in qa-page.php fixes the problem:

    function qa_page_queue_pending()
/*
    Queue any pending requests which are required independent of which page will be shown
*/
    {
        if (qa_to_override(__FUNCTION__)) return qa_call_override(__FUNCTION__, $args=func_get_args());
        
        qa_preload_options();
        $loginuserid=qa_get_logged_in_userid();
        
        if (isset($loginuserid)) {
            if (!QA_FINAL_EXTERNAL_USERS)
                qa_db_queue_pending_select('loggedinuser', qa_db_user_account_selectspec($loginuserid, true));
                
            qa_db_queue_pending_select('notices', qa_db_user_notices_selectspec($loginuserid));
        }
    
        qa_db_queue_pending_select('widgets', qa_db_widgets_selectspec());
        qa_db_queue_pending_select('navpages', qa_db_pages_selectspec());
        qa_db_select_with_pending(
            qa_db_pages_selectspec(),
            null
        );

    }

answered Dec 24, 2011 by NoahY
selected Jan 3 by Krzysztof Kielce
Yes, this must implicitly convert the permit value type into INT SIGNED. Works great, thanks. You guys rock !
guyz I am having the same problem with the link. I am using 1.5 beeta I am trying to add link on the navigation tab of my website page. But its only visible while I am on Admin>pages tab as soon as I move to other tab it just disappear. Can anyone tell me how to fix that. Please let me know the file name where to add/modify code. Because I am not familiar with QA codex.

Okay I have noticed its happening while integrated with Wordpress. any solution please.