mirror of
https://github.com/humhub/humhub.git
synced 2025-01-29 12:28:06 +01:00
fix bug yii\base\ErrorException: Trying to get property of non-object
in humhub/modules/stream/actions/Stream.php:308
This commit is contained in:
parent
40ecf23089
commit
167692a712
@ -295,17 +295,26 @@ abstract class Stream extends Action
|
||||
*/
|
||||
public static function renderEntry(ContentActiveRecord $record, $options = [], $partial = true)
|
||||
{
|
||||
// TODO should be removed in next major version
|
||||
// Compatibility with pre 1.2.2
|
||||
if(is_bool($options)) {
|
||||
$partial = $options;
|
||||
$options = [];
|
||||
}
|
||||
|
||||
$jsWidget = null;
|
||||
|
||||
if(isset($options['jsWidget'])) {
|
||||
$jsWidget = $options['jsWidget'];
|
||||
unset($options['jsWidget']);
|
||||
} else {
|
||||
$jsWidget = $record->getWallEntryWidget()->jsWidget;
|
||||
if ($record->getWallEntryWidget() !== null) {
|
||||
$jsWidget = $record->getWallEntryWidget()->jsWidget;
|
||||
}
|
||||
}
|
||||
|
||||
if ($jsWidget===null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ($partial) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user