From 4e7ceb1dde219d03e577c7c038e19f977c9abc29 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Sun, 12 Oct 2014 17:59:13 +0200 Subject: Separate the "has_cut" property from "do_single_page". Note: the following SQL should be used to upgrade the database: ALTER TABLE entries ADD COLUMN has_cut boolean NOT NULL DEFAULT FALSE ; UPDATE entries SET has_cut = (array_length(xpath('.//d:cut-here', content, ARRAY[ARRAY['d', 'http://www.madore.org/~david/NS/daml/']]), 1) NOTNULL) ; -- Check that the following returns nothing: SELECT edate , id FROM entries WHERE has_cut != ( do_single_page NOTNULL ) ; --- org/madore/damlengine/TodoWrefAttr.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'org/madore/damlengine/TodoWrefAttr.java') diff --git a/org/madore/damlengine/TodoWrefAttr.java b/org/madore/damlengine/TodoWrefAttr.java index 650297c..a2b67ac 100644 --- a/org/madore/damlengine/TodoWrefAttr.java +++ b/org/madore/damlengine/TodoWrefAttr.java @@ -70,8 +70,8 @@ public class TodoWrefAttr extends TodoAttr { wrefNumberStr, wrefSupplementStr); // Decide whether link target is on this page final boolean onThisPage; - if ( lk.singlePage != null && ! lk.supplementStr.equals("") ) { - // Linking to a _fragment_ of an entry that has a single page. + if ( esum != null && esum.hasCut && ! lk.supplementStr.equals("") ) { + // Linking to a _fragment_ of an entry that has a cut-here element. if ( ctx.wsc != null && ctx.wsc.sel != null && ctx.wsc instanceof Context.WeblogSingleSelectionContext && ((Context.WeblogSingleSelectionContext)ctx.wsc).number == wrefNumber ) -- cgit v1.2.3