Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/build "Corrected default polymorphic class names" when fields are related to ElementForm #43

Open
jakxnz opened this issue Jul 9, 2019 · 4 comments
Labels

Comments

@jakxnz
Copy link

jakxnz commented Jul 9, 2019

When a set of existing EditableFormFields are related to an ElementForm, running dev/build will "correct" the polymorphic relation to SilverStripe\UserForms\Model\UserDefinedForm and break the relationship.


Versions

dnadesign/silverstripe-elemental           4.1.0
dnadesign/silverstripe-elemental-userforms 3.0.0
silverstripe/userforms                     5.4.1

Steps to recreate

  • Create an ElementForm via the CMS
  • Add a set of fields and save
  • dev/build

Expected result

Relationship between fields and ElementForm is preserved

Actual result

Relationship between fields and ElementForm is decoupled - fields are no longer visible in the CMS under the corresponding ElementForm.

dev/build's records output says:

Corrected {x} default polymorphic class names to SilverStripe\UserForms\Model\UserDefinedForm

EditableFormField polymorphic relation class (field ParentClass) value is switched from DNADesign\ElementalUserForms\Model\ElementForm to SilverStripe\UserForms\Model\UserDefinedForm

@jakxnz
Copy link
Author

jakxnz commented Jul 9, 2019

A workaround is to disable the UserForm module's UpgradePolymorphicExtension "Upgrade on build" behaviour, by assigning the following config:

SilverStripe\UserForms\Model\UserDefinedForm:
  upgrade_on_build: false

@robbieaverill
Copy link
Contributor

Yep, that task was designed specifically for userforms when used with pages, during a SS3->SS4 upgrade. Disabling here is the right approach. Would you like to make a PR to the readme or documentation for this module to mention that?

@chrispenny
Copy link

Thanks for the fix, @jakxnz . I also just ran into this.

@sukhwinder-somar
Copy link
Contributor

sukhwinder-somar commented Aug 17, 2023

thanks @jakxnz, I also ran into this same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants