Closed oddnoc closed 2 years ago
Thank you for raising this!
Can you please share how you have applied the extensions, what version you are using, and any other info that might be useful in tracking down the issue?
This isn't something I've come across before, but perhaps we could chuck some logic in to check if the fields already exist before adding them.
Any chance you have extra calls to updateCMSFields()
in your project that is triggering fields to be added twice?
Cheers!
That was it -- there was an extra call to $this->extend('updateCMSFields', $fields)
in Page's getCMSFields. The person coding it hadn't realised that SiteTree already does so.
Sweet!
Would you be happy for me to close this issue?
The messages from getEmbargoExpiryFieldNoticeMessage (and others) show up twice in the CMS, as shown below. I confirmed that the method is actually called twice by making a local modification to add a static counter to the method (not shown, but easy to reproduce). However, I couldn't find where the second call is coming from.