guys, i'm hoping we can use a bit of our collective brain power to try
and figure out the final hows and whys of what's causing this bug.

For anyone who hasn't noticed this bug yet, the basics are that in a
seemingly random pattern, a select number of weblog entries will render
improperly.  The result will be a "null" value for the entry body if the
affected entry is the most recent entry for the weblog, otherwise the
result will show a duplicate entry body (i.e. the same entry body shown
for 2 consecutive entries).

I've done a lot of debugging of this problem over the past couple days
and I've traced the problem as such.  Inside the #showEntryText($entry)
macro, the line "#set( $entryText = $pageHelper.renderPlugins( $entry )
)" is mysteriously returning null for some group of (seemingly random)
weblog entries.  I have not been able to reproduce this on any weblog
with consistency, but the problem always seems to be occurring on one or
two weblogs at a time.

After tracing through the renderPlugins() method I narrowed the problem
down to the line ...

WeblogEntryData copy = new WeblogEntryData(entry.getPojo());

... where the problem is occuring because the copy entry has all null
values.  By all null values I mean that calling copy.getId() or
copy.getText() will return you a null.  Additional debugging shows that
the value of entry.getPojo() does not have any missing data.  Note that
this copy with null values only happens on that limited number of
entries that exhibit the problem.  All other entries (the majority) go
through this same process and end up with a perfectly valid copy filled
with all the right values.

I then added debugging messages inside the WeblogEntryData(otherEntry)
constructor and WeblogEntryData.setData(otherEntry) methods and found
that for some reason on the bug affected entries, the values of
otherEntry.* (when accessed directly) will always end up being null, but
the values of otherEntry.getXXX() comes out with the correct data at all
times.

This means that when an entry is being affected by this bug, for some
reason you cannot access the attributes of the entry directly because
they end up null, however if you access the attributes of the entry
through the getter methods the data comes out fine.

Now, I could simply convert the body of the setData() method to use the
getter methods instead of accessing the properties directly, but I would
like to fully understand the problem first.  What bothers me is that ...

- almost none of this code has changed between roller 1.3 and roller
2.0.  a couple additional lines were added to the
WeblogEntryData.setData() method which were additions for 2.0, but
nothing fundamental has changed.

- all rendered entries go through the exact same process, so why are
this very select few entries on seemingly random weblogs exhibiting this
problem and ending up with null copies?

- often times this problem will be seen on the homepage for a weblog,
but when viewing the permalink of the affected entry or the weblog
preview page the problem does not exist.  why?

- the problem also seems to jump around, affecting a given weblog for a
couple days (maybe until the user posts a new entry?) and then it will
stop happening.

- also strange is that you can typically fix the problem (at least in
the short term) by simply triggering a re-rendering of the page.  i.e.
by saving your website settings again.  you don't actually have to
change anything, simply make an update that would cause a re-rendering
and the problem will often go away.  why?

Right now I am still uncertain of the actual cause of the problem.  I've
narrowed down exactly where the problem is happening, but I don't know
the conditions which cause the problem.  I've compared the roller 1.3
and 2.0 code base and the only difference which seems like it could
possibly be relevant is that the WeblogEntryData object now extends a
class called WebsiteObject rather than the traditional PersistentObject
class.  I don't have any idea why that would cause this problem though.

So, i'm sorry that was so long winded, but my hope is that someone else
on this list may be able to offer me a clue as to what is causing this
problem so we can figure out the best way to fix it.

-- Allen


Reply via email to