phphub5 icon indicating copy to clipboard operation
phphub5 copied to clipboard

phphub5安装后报错Trying to get property of non-object (View ?

Open wei98k opened this issue 7 years ago • 1 comments

报错信息

只有点头条才会报这个错误, 其他栏目及后台都正常.

Whoops, looks like something went wrong.

3/3
ErrorException in 39b255622d2f2e5a618436d895ff4a05 line 47:
Trying to get property of non-object (View: /home/wwwroot/phphub5/resources/views/share_links/partials/share_links.blade.php) (View: /home/wwwroot/phphub5/resources/views/share_links/partials/share_links.blade.php)

image

我的处理

app/Http/Controllers/CategoriesController.php

 21         if ($category->id == config('phphub.hunt_category_id')) {
 22             $topics->load('share_link');
 23             //$view = 'share_links.index';
 24             $view = 'topics.index';       
 25         } else {

如果我装模板文件替换成 topics.index 就不报错了, 为什么使用share_links.index就会呢?

wei98k avatar Sep 22 '17 06:09 wei98k

遇到同样的问题。按照你的处理更改好,可以不出错,可是头条特有的布局就没有了!

chorylee avatar May 19 '18 15:05 chorylee