many_many_extraFields is not working on dataextension


#1

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.


#2

Looks fine to me. How did you apply the extension?


#3
# mysite/_config/mysite.yml

SilverStripe\Security\Member
  extensions:
    - SilverStripe\Lessons\MyMemberExtension

Member_Communities table gets generated but missing Sort & Location feilds


#4

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.


#5

Yes, they are in seperate files


#6

The $many_many_extraFields should also be a private static, not public.


#7

thank you for finding the bug in my code