- Posts: 1
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Notice: Undefined property: stdClass::$author ... Trying to get property of non-object
Notice: Undefined property: stdClass::$author ... Trying to get property of non-object
- Jennifer Spencer
- Offline
- New Member
Less
More
14 years 1 month ago #86142
by Jennifer Spencer
Replied by Jennifer Spencer on topic Notice: Undefined property: stdClass::$author ... Trying to get property of non-object
What steps will reproduce the problem?
1. Create a K2 article with author set to hidden (and php's error reporting is set to notice).
2. View the article in item layout
3. In some cases I got a notice message.
What is the expected output? What do you see instead?
I got 2 notice massages:
Notice: Undefined property: stdClass::$author in (...)\components\com_k2\views\item\view.html.php on line 58
Notice: Trying to get property of non-object in (...)\components\com_k2\views\item\view.html.php on line 58
What version of the product are you using? On what operating system?
2.3
Please provide any additional information below.
The line should be changed as follows for safer execution:
if (isset($item->author) && is_object($item->author->profile) && $item->author->profile->id > 0) {
(or load the author profile in any case in the model's prepare Item method)
Found on (code.google.com/p/joomlaworks/updates/list)
1. Create a K2 article with author set to hidden (and php's error reporting is set to notice).
2. View the article in item layout
3. In some cases I got a notice message.
What is the expected output? What do you see instead?
I got 2 notice massages:
Notice: Undefined property: stdClass::$author in (...)\components\com_k2\views\item\view.html.php on line 58
Notice: Trying to get property of non-object in (...)\components\com_k2\views\item\view.html.php on line 58
What version of the product are you using? On what operating system?
2.3
Please provide any additional information below.
The line should be changed as follows for safer execution:
if (isset($item->author) && is_object($item->author->profile) && $item->author->profile->id > 0) {
(or load the author profile in any case in the model's prepare Item method)
Found on (code.google.com/p/joomlaworks/updates/list)
Please Log in or Create an account to join the conversation.
- ruigato
- Offline
- New Member
Less
More
- Posts: 18
14 years 3 weeks ago #86143
by ruigato
Replied by ruigato on topic Notice: Undefined property: stdClass::$author ... Trying to get property of non-object
is there any fix available for this?
Jennifer Spencer said:What steps will reproduce the problem? 1. Create a K2 article with author set to hidden (and php's error reporting is set to notice).
2. View the article in item layout
3. In some cases I got a notice message.
What is the expected output? What do you see instead?
I got 2 notice massages:
Notice: Undefined property: stdClass::$author in (...)\components\com_k2\views\item\view.html.php on line 58
Notice: Trying to get property of non-object in (...)\components\com_k2\views\item\view.html.php on line 58
What version of the product are you using? On what operating system?
2.3
Please provide any additional information below.
The line should be changed as follows for safer execution:
if (isset($item->author) && is_object($item->author->profile) && $item->author->profile->id > 0) {
(or load the author profile in any case in the model's prepare Item method)
Found on (code.google.com/p/joomlaworks/updates/list)
Jennifer Spencer said:What steps will reproduce the problem? 1. Create a K2 article with author set to hidden (and php's error reporting is set to notice).
2. View the article in item layout
3. In some cases I got a notice message.
What is the expected output? What do you see instead?
I got 2 notice massages:
Notice: Undefined property: stdClass::$author in (...)\components\com_k2\views\item\view.html.php on line 58
Notice: Trying to get property of non-object in (...)\components\com_k2\views\item\view.html.php on line 58
What version of the product are you using? On what operating system?
2.3
Please provide any additional information below.
The line should be changed as follows for safer execution:
if (isset($item->author) && is_object($item->author->profile) && $item->author->profile->id > 0) {
(or load the author profile in any case in the model's prepare Item method)
Found on (code.google.com/p/joomlaworks/updates/list)
Please Log in or Create an account to join the conversation.
- thejamkit
- Offline
- New Member
Less
More
- Posts: 6
13 years 8 months ago #86144
by thejamkit
Replied by thejamkit on topic Notice: Undefined property: stdClass::$author ... Trying to get property of non-object
I tuned off Error reporting in Joomla! Global configuration under the server tab.... well actually set it up to default which I think is minimal, and doesnt show to the public end viewers. It may show up if you are logged in as an Administrator in the front end.
A patch or hack to this php file would really help though before the next release... any takers?
A patch or hack to this php file would really help though before the next release... any takers?
Please Log in or Create an account to join the conversation.
- Ruud
- Offline
- Junior Member
Less
More
- Posts: 25
13 years 7 months ago #86145
by Ruud
Replied by Ruud on topic Notice: Undefined property: stdClass::$author ... Trying to get property of non-object
Same here today after fiddling around with the Item View settings. Setting Error reporting in Joomla to Default solved it for now. Running K2 V2.4.1, patch would help!
Please Log in or Create an account to join the conversation.
- stavroch
- Offline
- Elite Member
Less
More
- Posts: 295
13 years 6 months ago #86146
by stavroch
Replied by stavroch on topic Notice: Undefined property: stdClass::$author ... Trying to get property of non-object
Please Log in or Create an account to join the conversation.
- Birg
- Offline
- New Member
Less
More
- Posts: 1
13 years 5 months ago #86147
by Birg
Replied by Birg on topic Notice: Undefined property: stdClass::$author ... Trying to get property of non-object
Sollution
Please Log in or Create an account to join the conversation.
- dvlancer
- Offline
- New Member
13 years 2 months ago #86148
by dvlancer
Replied by dvlancer on topic Notice: Undefined property: stdClass::$author ... Trying to get property of non-object
Just upgraded to 2.4.1 and have the same issue. Adding isset($item->author) fixed it.
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- Notice: Undefined property: stdClass::$author ... Trying to get property of non-object