I am noticing that sometimes in the cms that my pages will loose a couple fields from the Content/Metadata tab.
The fields that go missing are the title and description fields.
The last case of this (just happened) occurred after selecting another page in the left pane and duplicating it.
This is now the second time I have had this occur, the first I edited the title direct in the database..
I would rather not have to continue this way, so I am hoping that someone has come across this before??
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
OK, just tried adding a new page and still the fields are gone...
will have a look to see if I removed the fields in code somehow... can't imagine do that though.
Hi,
I have the same problem here. Im curious what have you found to solve this problem. Thanks!
john
Hi,
I just managed to fix this problem. this happens when you have conflict in your field names. For example you have a field named "Description" under Root.Content.Metadata and another "Description" in Root.Content.Whatever.
Hope this helps :)
Also watch how you define custom Getters. If you create a custom getter method for a field, and follow the pattern suggested in the tutorials, you might end up with these issues because _the CMS also ends up calling them_ to load its values.
A better approach would be to create custom getters for display purposes by naming them differently, like:
function getDisplayTitle() { return 'customPrefix ' . $this->getTitle(); } // or whatever
Then in the templates, you are always using $DisplayTitle and never $Title. This ensures that your pages will always use the custom logic, but the CMS will always load the original, actual value.