Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix non-callable accessor when accessor is not defined #94
I was looking at a broken
a) It's documented as "Return the accessor method ..."
I thought the most propriate fix would be to make the fallback
Waiting for input
I'm not familiar with Plone, so I'll wait an input on whether something could potentially depend on this seemingly broken implementation, and wether this should be marked as a bugfix or breaking change, if accepted at all?
Archetypes is old. If this was really a problem, then I would have expected this to pop up sooner. That is no guarantee though.
There is code in Archetypes that knows that
There should be a difference between 'this field has no accessor' and 'the value of this field is None'. With your fix, this difference would go away, which is probably not good.
The Travis tests passed though. I have started the Jenkins tests, which runs all core Plone tests. Let's see what that says.
Well, the Jenkins job actually passes, so that is good, but I still don't think this is the real solution. I guess this code path is not well tested.
Let me post a sample traceback first:
It's not clear where this could be fixed in PloneFormGen, as my first suggestion was. Maybe an accessor could be defined on PloneFormGen fields.
But with your fix it would simply go wrong differently. See these lines. Simplified, it calls
My suggestion would be to fix the
@mauritsvanrees Thanks for you review. I recall that @zemm did initially think about fixing this just in TinyMCEWidget, but then started wondering if this is more general issue and more proper fix is needed.
I agree that because we cannot be sure if that codepath is tested enough and if someone is already depending on the current behavior, fixing it for TinyMCEWidget only is good enough.
It was my assumption that such a change might not be feasible in such an old package. Would it be sensible to to update the method doc for future users to better reflect the reality, something like: