I am trying to create extrafeild on many-many relation, using dataextension as mentioned on the below link, but the extra fields defined in many_many_extraFields are not getting auto generated on ‘Member_Communities’ table.
https://hastebin.com/ikolakewec.xml
While many_many_extraFields does work on custom dataobjects.
Looks fine to me. How did you apply the extension?
# mysite/_config/mysite.yml
SilverStripe\Security\Member
extensions:
- SilverStripe\Lessons\MyMemberExtension
Member_Communities table gets generated but missing Sort & Location feilds
Other than then indentation, this looks fine as well. Did you do a dev/build
. Also, make sure both classes (extension and Community) are in separate files.
Yes, they are in seperate files
The $many_many_extraFields
should also be a private static, not public.
2 Likes
thank you for finding the bug in my code