已合并
!7 修改栏目下没有文章时,page标签不渲染的bug

yuana1:master铭飞:master

yuana1 创建于: 2017-09-13 10:17
542665_mingsoft铭飞 合并于 2017-09-13 10:21

0 条评论, 1 人参与 42427_zhaoky0918

登录 后才可以发表评论

1 文件发生了变化, 影响行数: +25 -24

-/**
-The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
-
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
-
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
-
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
+/**
+The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
+
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
package com.mingsoft.cms.parser;
 
import java.io.File;
@@ -647,11 +647,12 @@ public class CmsParser extends IGeneralParser {
if (size <= 0 || size > articleCount) {
size = articleCount;
}
+ //设置page实例,防止该栏目下没有文章时,page标签不渲染
+ if (page==null) {
+ page = new PageUtilHtml(curPageNo, size, articleCount, listLinkPath);
+ }
// 当数据库中该栏目下没有该文章时不取数据
if (articleCount != 0) {
- if (page==null) {
- page = new PageUtilHtml(curPageNo, size, articleCount, listLinkPath);
- }
/**
* 判断文章列表的orderby属性
*/