Re: Custom type is missing id_schema in reg_form
from
Tim Hicks
on Dec 14, 2006 03:01 PM
Rob Miller wrote:
>> I'm afraid it's in a private repo, so I've pasted to somewhere
>> temporary. See <http://paste.plone.org/12090> for my schema definition
>> and <http://paste.plone.org/12091> for my member class.
>
> this helps, thanks.
>
> the first thing i notice is that you're importing the schema parts from
> remember's member schema, but you're not copying them. it's generally a
> good idea to do "schema.copy()" on an imported schema before using it,
> to ensure that you've got a completely separate entity from the
> originally imported schema, and don't inadvertently monkey-patch the
> base class.
Ah yes, thanks. I should've known having recently seen a Quills bug
along these lines.
> the other suspicious looking piece is the following, from your member
> definition module:
>
>
> # Lifted from Products.remember.content.member
> # This seems rather magic!
> metadata_schema = ExtensibleMetadata.schema.copy()
> # Establish the field order
> full_wimax_member_schema = wimax_member_schema + metadata_schema
> # metadata_schema doesn't override any fields in content_schema
> full_wimax_member_schema = full_wimax_member_schema + wimax_member_schema
>
>
> that strikes me as very odd... essentially what you're saying is:
>
> full_wimax_member_schema = wimax_member_schema + metadata_schema_ +
> wimax_member_schema
>
> your comment implies that it was lifted from remember itself, though. i
> checked, and sure enough remember does something very similar:
>
> http://dev.plone.org/collective/changeset/30301
>
> rossp, are you out there? can you explain what the purpose of that
> change was? it definitely strikes me as odd.
Yes, it looks odd indeed. For the record, my issue was present before I
added that schema hackery lifted from remember. I only added it in the
hope that it would somehow resolve my issue.
Tim