Closed asyncee closed 5 years ago
More notes:
a) tag page not working in admin with described exception
b) related artifacts do not rebuild automatically, for example, when i add new tags to blog-post (new tag pages not created)
c) lektor clean && lektor build
gives correct output
If you need to see the code, please check here. Final result you can see here.
I’m also seeing this. This is somehow related to SourceObject.pad
being a weakref
. You can see that this plays into the issue when you apply the following, seemingly nonsensical, patch, which will keep the pad from being garbage collected.
diff --git a/lektor_tags.py b/lektor_tags.py
index d75c8c8..666317a 100644
--- a/lektor_tags.py
+++ b/lektor_tags.py
@@ -23,6 +23,7 @@ def __init__(self, parent, tag):
VirtualSourceObject.__init__(self, parent)
self.plugin = parent.pad.env.plugins['tags']
self.tag = tag
+ self.i_want_to_live = self.pad
@property
def items(self):
I don’t grok Lector’s data model or API well enough to say whether this is a bug in Lektor or in lektor-tags, though.
@eigengrau, that was helpful. I was seeing the same issue, and the patch to lektor_tags also seems to have resolved it.
@eigengrau Thanks so much for posting a fix! I don't know why I didn't come across this issue earlier, had been looking for a solution to that "Pad went away" error for a while already!
I have also been Googling around. "The pad went away" is a really weird error message to throw. Is there a PR we can put in to fix this, @nixjdm?
For a while I was able to reproduce this with https://github.com/ags-slc/lektor-test (once the config was corrected). @eigengrau's solution making another strong reference to the pad did fix it for me. I'll include that fix and make a new release of this plugin, but the issue deserves some thought in lektor core too I think, so I'll also make note of it over there.
@nixjdm thank you so much for looping back!
@ericmjl You're welcome! Sorry you had to wait so long!
Hello!
There are some strange behaviour when using your plugin: if i do any mistake (in configuration, or, say in template) then exception
Pad went away
will be raised.It took few hours to understand what is really going on to fix this issue in my project — everything because of unrelated stacktrace:
In my case mistakes were related with:
a)
tags.html
instead oftag.html
template b){{ this.pagination }}
is unsupported by pluginSo, the problem is that i spend a few hours to notice that problems are not in lektor core and not in your plugin, but in my code.