本帖最后由 ye_819 于 2015-10-15 16:04 编辑
Bug现象:当服务器运行缓慢时,pre_common_nav中不停的出现新记录,删掉了还出来。
Bug原因:source/function/cache/cache_setting.php中505行左右,以下的这部分代码,判断pre_common_nav表中是否有些插件,没有则插入新数据,当服务器运行缓慢时返回false,而不是“0”,所以只要有人刷新页面,就会不断的把数据插入到pre_common_nav表中。- if(!(C::t('common_nav')->count_by_navtype_type_identifier($navtype, 3, $plugin['identifier'])) ) {
- C::t('common_nav')->insert(array(
- 'name' => $module['menu'],
- 'title' => $module['navtitle'],
- 'url' => $module['url'],
- 'type' => 3,
- 'identifier' => $plugin['identifier'],
- 'navtype' => $navtype,
- 'available' => 1,
- 'icon' => $module['navicon'],
- 'subname' => $module['navsubname'],
- 'suburl' => $module['navsuburl'],
- ));
- }
复制代码 如何修改:只要用全等来判断返回值是否为“0”就可以了,修改如下:
- if((C::t('common_nav')->count_by_navtype_type_identifier($navtype, 3, $plugin['identifier'])) === "0") {
- C::t('common_nav')->insert(array(
- 'name' => $module['menu'],
- 'title' => $module['navtitle'],
- 'url' => $module['url'],
- 'type' => 3,
- 'identifier' => $plugin['identifier'],
- 'navtype' => $navtype,
- 'available' => 1,
- 'icon' => $module['navicon'],
- 'subname' => $module['navsubname'],
- 'suburl' => $module['navsuburl'],
- ));
- }
复制代码
|