phpMyFAQ notice [8]: Trying to get property of non-object in

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

Thorsten

Upgraded from 2.0.11 to 2.6.7

First off, I have no directorys called /data or /attachments. Am I supposed to CREATE THEM?
And if so, are permissions supposed to be set differently?

Second, on every faq page, on top I get:

phpMyFAQ notice [8]: Trying to get property of non-object in Mysqli.php on line 176

Then the page opens without the stylesheet.

http://www.cybermidi.com/faq

Any help?

thanks
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,
First off, I have no directorys called /data or /attachments. Am I supposed to CREATE THEM?
And if so, are permissions supposed to be set differently?
you deleted them? You could use the old ones as well. Just re-create both and make them accessible for the webserver for writing.
phpMyFAQ notice [8]: Trying to get property of non-object in Mysqli.php on line 176
Do you have access to the webservers errorlog?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

Throsten, yes I do have access to error logs, but they are empty.
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

could you please activate the debug mode in inc/Init.php and try it again? Thanks!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

OK, did that. Same problem, although the error line was just
a bit longer and pointed toward the exact file

inc/PMF_DB/Mysqli.php on line 176
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

please post the debug output here. :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

phpMyFAQ notice [8]: Trying to get property of non-object in /hermes/web01/b1371/mydomainpath/htdocs/faq/inc/PMF_DB/Mysqli.php on line 176
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

Sorry, here is the debug info - i didn't see it as it is at the bottom:

Code: Select all

DEBUG INFORMATION:
/hermes/web01/b1371/mydomain/htdocs/faq/inc/Init.php:
PMF_Configuration->getAll() in line 103:

            SELECT
                config_name, config_value
            FROM
                faq_faqconfig


/hermes/web01/b1371/mydomain/htdocs/faq/index.php:
PMF_Session->checkSessionId() in line 205:

            SELECT
                sid
            FROM
                faq_faqsessions
            WHERE
                sid = 286799
            AND
                ip = '23.131.111.111'   (I changed this for this example)
            AND
                time > 1281290660


/hermes/web01/b1371/mydomain/htdocs/faq/index.php:
PMF_Session->checkSessionId() in line 205:

                UPDATE
                    faq_faqsessions
                SET
                    time = 1281377060,
                    user_id = -1
                WHERE
                    sid = 286799
                    AND ip = '23.131.111.111'


/hermes/web01/b1371/mydomain/htdocs/faq/inc/Category.php:
PMF_Category->getOrderedCategories() in line 154:

            SELECT
                fc.id AS id,
                fc.lang AS lang,
                fc.parent_id AS parent_id,
                fc.name AS name,
                fc.description AS description,
                fc.user_id AS user_id
            FROM
                faq_faqcategories fc
            LEFT JOIN
                faq_faqcategory_group fg
            ON
                fc.id = fg.category_id
            LEFT JOIN
                faq_faqcategory_user fu
            ON
                fc.id = fu.category_id
            WHERE
                ( fg.group_id IN (-1)
            OR
                (fu.user_id = -1 AND fg.group_id IN (-1)))
            AND
                fc.lang = 'en'
            GROUP BY
                fc.id, fc.lang, fc.parent_id, fc.name, fc.description, fc.user_id
            ORDER BY
                fc.id


/hermes/web01/b1371/mydomain/htdocs/faq/index.php:
PMF_Faq->getRecordTitle() in line 263:

SELECT
                thema
            FROM
                faq_faqdata
            WHERE
                id = 8 AND lang = 'en'


/hermes/web01/b1371/mydomain/htdocs/faq/index.php:
PMF_Faq->getRecordKeywords() in line 264:

SELECT
                keywords
            FROM
                faq_faqdata
            WHERE id = 8 AND lang = 'en'


/hermes/web01/b1371/mydomain/htdocs/faq/index.php:
PMF_Faq->getRecordPreview() in line 265:

            SELECT
                content as answer
            FROM
                faq_faqdata
            WHERE 
                id = 8 
            AND 
                lang = 'en'


/hermes/web01/b1371/mydomain/htdocs/faq/inc/Category.php:
PMF_Category->getCategoriesFromArticle() in line 913:

            SELECT
                fc.id AS id,
                fc.lang AS lang,
                fc.parent_id AS parent_id,
                fc.name AS name,
                fc.description AS description
            FROM
                faq_faqcategoryrelations fcr,
                faq_faqcategories fc
            WHERE
                fc.id = fcr.category_id
            AND
                fcr.record_id = 8
            AND
                fcr.category_lang = 'en'
            AND
                fc.lang = 'en'


/hermes/web01/b1371/mydomain/htdocs/faq/index.php:
PMF_Tags->existTagRelations() in line 368:

            SELECT
                COUNT(record_id) AS n
            FROM
                faq_faqdata_tags


/hermes/web01/b1371/mydomain/htdocs/faq/index.php:
PMF_Session->getUsersOnline() in line 392:

                SELECT
                    count(sid) AS anonymous_users
                FROM
                    faq_faqsessions
                WHERE
                    user_id = -1
                AND 
                    time > 1281376760


/hermes/web01/b1371/mydomain/htdocs/faq/index.php:
PMF_Session->getUsersOnline() in line 392:

                SELECT
                    count(session_id) AS registered_users
                FROM
                    faq_faquser
                WHERE
                    session_timestamp > 1281376760


/hermes/web01/b1371/mydomain/htdocs/faq/inc/Faq.php:
PMF_Faq->getStickyRecordsData() in line 2991:

            SELECT
                fd.id AS id,
                fd.lang AS lang,
                fd.thema AS thema,
                fcr.category_id AS category_id
            FROM
                faq_faqdata fd
            LEFT JOIN
                faq_faqcategoryrelations fcr
            ON
                fd.id = fcr.record_id
            AND
                fd.lang = fcr.record_lang
            LEFT JOIN
                faq_faqdata_group AS fdg
            ON
                fd.id = fdg.record_id
            LEFT JOIN
                faq_faqdata_user AS fdu
            ON
                fd.id = fdu.record_id
            WHERE
                fd.lang = 'en'
            AND 
                fd.date_start <= '20100809200421'
            AND 
                fd.date_end   >= '20100809200421'
            AND 
                fd.active = 'yes'
            AND 
                fd.sticky = 1
            AND
                ( fdu.user_id = -1 OR fdu.user_id = -1 )

Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

thanks.... I will work on a fix.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
kmr
Posts: 1
Joined: Mon Aug 31, 2009 4:55 am

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by kmr »

I seem to be having a similar problem after an upgrade from 2.5.5 to 2.6.7:

phpMyFAQ notice [8]: Trying to get property of non-object in Mysqli.php on line 176

Debug info:

Code: Select all

DEBUG INFORMATION:
C:\Inetpub\wwwroot\faq\inc\Init.php:
PMF_Configuration->getAll() in line 103:
            SELECT
                config_name, config_value
            FROM
                faqconfig

C:\Inetpub\wwwroot\faq\index.php:
PMF_Session->checkSessionId() in line 205:
            SELECT
                sid
            FROM
                faqsessions
            WHERE
                sid = 9106
            AND
                ip = '10.144.38.11'
            AND
                time > 1281707677

C:\Inetpub\wwwroot\faq\index.php:
PMF_Session->checkSessionId() in line 205:
                UPDATE
                    faqsessions
                SET
                    time = 1281794077,
                    user_id = -1
                WHERE
                    sid = 9106
                    AND ip = '10.144.38.11'

C:\Inetpub\wwwroot\faq\inc\Category.php:
PMF_Category->getOrderedCategories() in line 154:
            SELECT
                fc.id AS id,
                fc.lang AS lang,
                fc.parent_id AS parent_id,
                fc.name AS name,
                fc.description AS description,
                fc.user_id AS user_id
            FROM
                faqcategories fc
            LEFT JOIN
                faqcategory_group fg
            ON
                fc.id = fg.category_id
            LEFT JOIN
                faqcategory_user fu
            ON
                fc.id = fu.category_id
            WHERE
                ( fg.group_id IN (-1)
            OR
                (fu.user_id = -1 AND fg.group_id IN (-1)))
            AND
                fc.lang = 'en'
            GROUP BY
                fc.id, fc.lang, fc.parent_id, fc.name, fc.description, fc.user_id
            ORDER BY
                fc.id

C:\Inetpub\wwwroot\faq\index.php:
PMF_Faq->getRecordTitle() in line 263:
SELECT
                thema
            FROM
                faqdata
            WHERE
                id = 177 AND lang = 'en'

C:\Inetpub\wwwroot\faq\index.php:
PMF_Faq->getRecordKeywords() in line 264:
SELECT
                keywords
            FROM
                faqdata
            WHERE id = 177 AND lang = 'en'

C:\Inetpub\wwwroot\faq\index.php:
PMF_Faq->getRecordPreview() in line 265:
            SELECT
                content as answer
            FROM
                faqdata
            WHERE 
                id = 177 
            AND 
                lang = 'en'

C:\Inetpub\wwwroot\faq\inc\Category.php:
PMF_Category->getCategoriesFromArticle() in line 913:
            SELECT
                fc.id AS id,
                fc.lang AS lang,
                fc.parent_id AS parent_id,
                fc.name AS name,
                fc.description AS description
            FROM
                faqcategoryrelations fcr,
                faqcategories fc
            WHERE
                fc.id = fcr.category_id
            AND
                fcr.record_id = 177
            AND
                fcr.category_lang = 'en'
            AND
                fc.lang = 'en'

C:\Inetpub\wwwroot\faq\index.php:
PMF_Tags->existTagRelations() in line 368:
            SELECT
                COUNT(record_id) AS n
            FROM
                faqdata_tags

C:\Inetpub\wwwroot\faq\index.php:
PMF_Session->getUsersOnline() in line 392:
                SELECT
                    count(sid) AS anonymous_users
                FROM
                    faqsessions
                WHERE
                    user_id = -1
                AND 
                    time > 1281793777

C:\Inetpub\wwwroot\faq\index.php:
PMF_Session->getUsersOnline() in line 392:
                SELECT
                    count(session_id) AS registered_users
                FROM
                    faquser
                WHERE
                    session_timestamp > 1281793777

C:\Inetpub\wwwroot\faq\inc\Faq.php:
PMF_Faq->getStickyRecordsData() in line 2991:
            SELECT
                fd.id AS id,
                fd.lang AS lang,
                fd.thema AS thema,
                fcr.category_id AS category_id
            FROM
                faqdata fd
            LEFT JOIN
                faqcategoryrelations fcr
            ON
                fd.id = fcr.record_id
            AND
                fd.lang = fcr.record_lang
            LEFT JOIN
                faqdata_group AS fdg
            ON
                fd.id = fdg.record_id
            LEFT JOIN
                faqdata_user AS fdu
            ON
                fd.id = fdu.record_id
            WHERE
                fd.lang = 'en'
            AND 
                fd.date_start <= '20100814155437'
            AND 
                fd.date_end   >= '20100814155437'
            AND 
                fd.active = 'yes'
            AND 
                fd.sticky = 1
            AND
                ( fdg.group_id IN (-1)
            OR
                (fdu.user_id = -1 AND fdg.group_id IN (-1)))
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

I need your help for debugging this. Please open the file inc/PMF_DB/Mysqli.php and go to line 174. Please change the method num_rows() to the following code:

Code: Select all

    public function num_rows($result)
    {
        if (!is_object($result)) {
            debug_print_backtrace();
        }
        return $result->num_rows;
    }
Now you should get a good stacktrace. Thanks!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

Ok Thorsten,
This appears at the TOP of the page:

Code: Select all

#0 PMF_DB_Mysqli->num_rows() called at [/hermes/web01/b1371/pow.mydomain/htdocs/faq/inc/PMF_Search/Database/Mysqli.php:83] #1 PMF_Search_Database_Mysqli->search(I cannot hear the demos no soundsound) called at [/hermes/web01/b1371/pow.mydomain/htdocs/faq/inc/Relation.php:157] #2 PMF_Relation->getAllRelatedById(59, I cannot hear the demos - no sound, sound) called at [/hermes/web01/b1371/pow.mydomain/htdocs/faq/artikel.php:277] #3 require_once(/hermes/web01/b1371/pow.mydomain/htdocs/faq/artikel.php) called at [/hermes/web01/b1371/pow.mydomain/htdocs/faq/index.php:584]
phpMyFAQ notice [8]: Trying to get property of non-object in /hermes/web01/b1371/pow.mydomain/htdocs/faq/inc/PMF_DB/Mysqli.php on line 179
and this appears near the bottom before the footer:

Code: Select all

DEBUG INFORMATION:
/hermes/web01/b1371/pow.mydomain/htdocs/faq/inc/Init.php:
PMF_Configuration->getAll() in line 103:

            SELECT
                config_name, config_value
            FROM
                faq_faqconfig


/hermes/web01/b1371/pow.mydomain/htdocs/faq/index.php:
PMF_Session->checkSessionId() in line 205:

            SELECT
                sid
            FROM
                faq_faqsessions
            WHERE
                sid = 287363
            AND
                ip = '24.193.195.242'
            AND
                time > 1281787302


/hermes/web01/b1371/pow.mydomain/htdocs/faq/index.php:
PMF_Session->checkSessionId() in line 205:

                UPDATE
                    faq_faqsessions
                SET
                    time = 1281873702,
                    user_id = -1
                WHERE
                    sid = 287363
                    AND ip = '24.193.195.242'


/hermes/web01/b1371/pow.mydomain/htdocs/faq/inc/Category.php:
PMF_Category->getOrderedCategories() in line 154:

            SELECT
                fc.id AS id,
                fc.lang AS lang,
                fc.parent_id AS parent_id,
                fc.name AS name,
                fc.description AS description,
                fc.user_id AS user_id
            FROM
                faq_faqcategories fc
            LEFT JOIN
                faq_faqcategory_group fg
            ON
                fc.id = fg.category_id
            LEFT JOIN
                faq_faqcategory_user fu
            ON
                fc.id = fu.category_id
            WHERE
                ( fg.group_id IN (-1)
            OR
                (fu.user_id = -1 AND fg.group_id IN (-1)))
            AND
                fc.lang = 'en'
            GROUP BY
                fc.id, fc.lang, fc.parent_id, fc.name, fc.description, fc.user_id
            ORDER BY
                fc.id


/hermes/web01/b1371/pow.mydomain/htdocs/faq/index.php:
PMF_Faq->getRecordTitle() in line 263:

SELECT
                thema
            FROM
                faq_faqdata
            WHERE
                id = 59 AND lang = 'en'


/hermes/web01/b1371/pow.mydomain/htdocs/faq/index.php:
PMF_Faq->getRecordKeywords() in line 264:

SELECT
                keywords
            FROM
                faq_faqdata
            WHERE id = 59 AND lang = 'en'


/hermes/web01/b1371/pow.mydomain/htdocs/faq/index.php:
PMF_Faq->getRecordPreview() in line 265:

            SELECT
                content as answer
            FROM
                faq_faqdata
            WHERE 
                id = 59 
            AND 
                lang = 'en'


/hermes/web01/b1371/pow.mydomain/htdocs/faq/inc/Category.php:
PMF_Category->getCategoriesFromArticle() in line 913:

            SELECT
                fc.id AS id,
                fc.lang AS lang,
                fc.parent_id AS parent_id,
                fc.name AS name,
                fc.description AS description
            FROM
                faq_faqcategoryrelations fcr,
                faq_faqcategories fc
            WHERE
                fc.id = fcr.category_id
            AND
                fcr.record_id = 59
            AND
                fcr.category_lang = 'en'
            AND
                fc.lang = 'en'


/hermes/web01/b1371/pow.mydomain/htdocs/faq/index.php:
PMF_Tags->existTagRelations() in line 368:

            SELECT
                COUNT(record_id) AS n
            FROM
                faq_faqdata_tags


/hermes/web01/b1371/pow.mydomain/htdocs/faq/index.php:
PMF_Session->getUsersOnline() in line 392:

                SELECT
                    count(sid) AS anonymous_users
                FROM
                    faq_faqsessions
                WHERE
                    user_id = -1
                AND 
                    time > 1281873402


/hermes/web01/b1371/pow.mydomain/htdocs/faq/index.php:
PMF_Session->getUsersOnline() in line 392:

                SELECT
                    count(session_id) AS registered_users
                FROM
                    faq_faquser
                WHERE
                    session_timestamp > 1281873402


/hermes/web01/b1371/pow.mydomain/htdocs/faq/inc/Faq.php:
PMF_Faq->getStickyRecordsData() in line 2991:

            SELECT
                fd.id AS id,
                fd.lang AS lang,
                fd.thema AS thema,
                fcr.category_id AS category_id
            FROM
                faq_faqdata fd
            LEFT JOIN
                faq_faqcategoryrelations fcr
            ON
                fd.id = fcr.record_id
            AND
                fd.lang = fcr.record_lang
            LEFT JOIN
                faq_faqdata_group AS fdg
            ON
                fd.id = fdg.record_id
            LEFT JOIN
                faq_faqdata_user AS fdu
            ON
                fd.id = fdu.record_id
            WHERE
                fd.lang = 'en'
            AND 
                fd.date_start <= '20100815140142'
            AND 
                fd.date_end   >= '20100815140142'
            AND 
                fd.active = 'yes'
            AND 
                fd.sticky = 1
            AND
                ( fdu.user_id = -1 OR fdu.user_id = -1 )
Hope you can resolve soon or I will have to try to revert to an older version if I can.
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

could you please try to change the code in line 83 in inc/PMF_Search/Database/Mysqli.php from

Code: Select all

            if (0 == $this->dbHandle->num_rows($this->resultSet)) {
to

Code: Select all

            if (is_object($this->resultSet) && 0 == $this->dbHandle->num_rows($this->resultSet)) {
Thanks!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
notset4life
Posts: 30
Joined: Tue Oct 18, 2005 2:02 pm

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by notset4life »

Ok, just leads to a BLANK PAGE, nothing, just blank.
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: phpMyFAQ notice [8]: Trying to get property of non-object in

Post by Thorsten »

Hi,

that makes no sense, are you sure, that you only changed that line of code?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply