Rull request created: https://github.com/apache/jspwiki/pull/350

On Sun, Jun 23, 2024 at 12:43 PM Ulf Dittmer <ulf.ditt...@googlemail.com>
wrote:

> Thanks Dirk, I wasn't aware of the findFreeEntry method. It basically
> confirms that there is no built-in method to search for pages by pattern,
> and that a linear search must be employed. Practically, I think checking
> the first 10 or so would be sufficient, as it would be highly unusual to
> write more than 10 blog entries on any given day, and then to delete most
> of them.
>
> I'll see what I can come up with.
>
> Ulf
>
> On Sat, Jun 22, 2024 at 10:35 PM Dirk Frederickx <
> dirk.frederi...@gmail.com> wrote:
>
>> Ulf,
>>
>> The problem seems to be in o.a.w.tags/CalenderTag.java  in getDayLink().
>>
>> It only checks for the page with the pattern
>> ${param.page}_blogentry_'ddMMyy'_1
>> ;  which has the suffix "_1".
>>
>> I guess it should actually also check for the existence of pages with a
>> higher _nn.
>> It should stop at MAX_BLOG_ENTRIES (now set tot 10_000), but that would be
>> performance wise not realistic.
>> Better would be to check for the existence of pages starting with the
>> pattern ${param.page}_blogentry_'ddMMyy'_ followed by a /\d+/.
>> Possibly you can find inspiration in  o.a.w.plugin/WeblogEntryPlugin in
>> findFreeEntry()   which is used to create new entries.
>>
>>
>> Grtz
>>   dirk
>>
>> On Fri, Jun 21, 2024 at 10:15 AM Ulf Dittmer
>> <ulf.ditt...@googlemail.com.invalid> wrote:
>>
>> > The CalendarTag, when deciding whether to link a particular day, assumes
>> > that the presence or absence of a page "..._blogentry_'ddMMyy'_1'
>> indicates
>> > whether there are weblog entries for a given day (this is in
>> Sidebar.jsp).
>> >
>> > The problem is, if the first entry on that day (the one with ..._1) is
>> > deleted, others on that day (..._2 etc.) are not checked, and so that
>> day
>> > is not linked.
>> >
>> > You can see this on
>> >
>> https://jspwiki-wiki.apache.org/Wiki.jsp?page=Haddock%20Weblog%20Example
>> > I created two blog entries, and then deleted the first one. Today's date
>> > (June 21) should still be highlighted and linked because of the second
>> > entry, but it isn't.
>> >
>> > I'm not asking for this to be fixed, I'm just looking for advice on what
>> > the best approach would be. If there's a reasonable solution, I'd be
>> happy
>> > to work on that and contribute it.
>> >
>> > Ulf
>> >
>>
>

Reply via email to