We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

plugin errors | Forum

OW-Ghost
OW-Ghost Feb 14 '20
Hello


I go this notice errors that fill my error log with 1000000000 notice same


[Fri Feb 14 17:45:20 2020] [ow_core_log] [Notice] Message: Trying to get property of non-object File: /var/www/html/ow_plugins/hideadmin/classes/event_handler.php Line:99[Fri Feb 14 17:51:24 2020] [ow_core_log] [Notice] Message: Trying to get property of non-object File: /var/www/html/ow_plugins/hideadmin/classes/event_handler.php Line:99[Fri Feb 14 17:52:49 2020] [ow_core_log] [Notice] Message: Trying to get property of non-object File: /var/www/html/ow_plugins/hideadmin/classes/event_handler.php Line:99[Fri Feb 14 17:53:51 2020] [ow_core_log] [Notice] Message: Trying to get property of non-object File: /var/www/html/ow_plugins/hideadmin/classes/event_handler.php Line:99[Fri Feb 14 17:58:27 2020] [ow_core_log] [Notice] Message: Trying to get property of non-object File: /var/www/html/ow_plugins/hideadmin/classes/event_handler.php Line:99[Fri Feb 14 18:01:46 2020] [ow_core_log] [Notice] Message: Trying to get property of non-object File: /var/www/html/ow_plugins/hideadmin/classes/event_handler.php Line:99[Fri Feb 14 18:02:17 2020] [ow_core_log] [Notice] Message: Trying to get property of non-object File: /var/www/html/ow_plugins/hideadmin/classes/event_handler.php Line:99[Fri Feb 14 18:12:09 2020] [ow_core_log] [Notice] Message: Trying to get property of non-object File: /var/www/html/ow_plugins/hideadmin/classes/event_handler.php Line:99[Fri Feb 14 18:12:47 2020] [ow_core_log] [Notice] Message: Trying to get property of non-object File: /var/www/html/ow_plugins/hideadmin/classes/event_handler.php Line:99[Fri Feb 14 18:13:26 2020] [ow_core_log] [Notice] Message: Trying to get property of non-object File: /var/www/html/ow_plugins/hideadmin/classes/event_handler.php Line:99[Fri Feb 14 18:14:44 2020] [ow_core_log] [Notice] Message: Trying to get property of non-object File: /var/www/html/ow_plugins/hideadmin/classes/event_handler.php Line:99[Fri Feb 14 18:18:00 2020] [ow_core_log] [Notice] Message: Trying to get property of non-object File: /var/www/html/ow_plugins/hideadmin/classes/event_handler.php Line:99



someone can help me fix this that have code skills?


the developer is very slow respond to feedback about this plugin


Thanks in advance


Ow_ghost

The Forum post is edited by OW-Ghost Feb 14 '20
OW-Ghost
OW-Ghost Feb 14 '20
Yes i was today doing that. 


Is there any other plugin that hide admin?


Or someone else know what the problem is with the code?

OW-Ghost
OW-Ghost Feb 14 '20
on event handler line 99 it says:


$profileUserId = BOL_UserService::getInstance()->findByUsername($profileUserName)->id;

OW-Ghost
OW-Ghost Feb 14 '20


here is the entirely public function and line 99

OW-Ghost
OW-Ghost Feb 14 '20


hmmmm,,,,i think you right


why can not locate the user admin.?....hmmm


interesting indeed :)


hope someone can understand what is wrong

The Forum post is edited by OW-Ghost Feb 14 '20
OW-Ghost
OW-Ghost Feb 14 '20
for some reason template_c did not have correct file permisson?


so i change to correct and i will see if that will solve the problem?

OW-Ghost
OW-Ghost Feb 14 '20
did not help?


still same "notice" error on line 99

OW-Ghost
OW-Ghost Feb 14 '20
i will test sign out and see if i still get the error
OW-Ghost
OW-Ghost Feb 14 '20
yes still same errors
OW-Ghost
OW-Ghost Feb 14 '20
i think it not find admin id or admin username.....


but i not good at php at all...just guessing

Marcus
Marcus Feb 15 '20
Don't know your array object by its got to be like this...


$profileUserId = BOL_UserService::getInstance()->findByUsername($profileUserName->id):
Oxwall Germany Club
Oxwall Germany Feb 15 '20
Topic was moved from General Questions.
OW-Ghost
OW-Ghost Feb 15 '20

Yes why end with : and not ; 


I want to know to?

Quote from Marcus Don't know your array object by its got to be like this...

$profileUserId = BOL_UserService::getInstance()->findByUsername($profileUserName->id):




Marcus
Marcus Feb 15 '20
Sorry my bad didn't notice it using my cell. Replace your line with mine...


$profileUserId = BOL_UserService::getInstance()->findByUsername($profileUserName->id);


Lets see what's up. 


Your line looks like this which is well wrong. 

$profileUserId = BOL_UserService::getInstance()->findByUsername($profileUserName)->id

Here your charing to access object and fetch value of ID. 


$profileUserName->id

Just a simple mistake can happen to anybody. 

The Forum post is edited by Marcus Feb 15 '20
Marcus
Marcus Feb 15 '20
I see what's he trying to do...


$profileUserId = BOL_UserService::getInstance()->findByUsername($profileUserName);


$profileUserId = $profileUserId->id;

Marcus
Marcus Feb 15 '20
Not sure whether this returns object or array...


BOL_UserService::getInstance()->findByUsername($profileUserName);


I'm not in front of my pc so can't test it. 
The Forum post is edited by Marcus Feb 15 '20
Marcus
Marcus Feb 15 '20
Do this...

Find line 92 right which is this right. 

$profileUserId = BOL_UserService::getInstance()->findByUsername($profileUserName)->id;

Above ir add this.. 


print_r(BOL_UserService::getInstance()->findByUsername($profileUserName)) ;
exit;

Save and refresh any page tell me what you see... 



Senior Developer Leader
Senior Developer Feb 15 '20
That's a NOTICE, not an error.


That logs says the profile they tried to navigate to, does not exist.


This may be caused when you delete a user and they try to access to that user's profile. Or when they try to access to an nonexistent profile url.


To fix this replace this line:


$profileUserId = BOL_UserService::getInstance()->findByUsername($profileUserName)->id;


With this 2 lines:

$oUser = BOL_UserService::getInstance()->findByUsername($profileUserName);

$profileUserId = ($oUser) ? $oUser->id : 0;


That should solve the NOTICE.


Senior Developer.

The Forum post is edited by Senior Developer Feb 15 '20
OW-Ghost
OW-Ghost Feb 15 '20

Thanks for the fix Senior Developer


Do admin have id 0 ? 


hmmmm....just want to know why it not find the admin id or what it is looking for...


i was check database and my admin id is = 1 


is that normal?


not sure how this plugin working. but it should hide admins for other members is the main goal


hmm interesting

The Forum post is edited by OW-Ghost Feb 15 '20
OW-Ghost
OW-Ghost Feb 15 '20
i worry my live site will go down ....hmm....what is this code doing that you send ?
Quote from Marcus Do this...
Find line 92 right which is this right. 
$profileUserId = BOL_UserService::getInstance()->findByUsername($profileUserName)->id;

Above ir add this.. 

print_r(BOL_UserService::getInstance()->findByUsername($profileUserName)) ;
exit;
Save and refresh any page tell me what you see... 



Pages: 1 2 »