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

Check if FieldList has tabset before trying to add cms fields to tabs. #248

Merged
merged 1 commit into from Aug 1, 2016
Merged

Check if FieldList has tabset before trying to add cms fields to tabs. #248

merged 1 commit into from Aug 1, 2016

Conversation

3Dgoo
Copy link
Contributor

@3Dgoo 3Dgoo commented Jul 28, 2016

If we try to add Translatable to the File class the files section errors.

This is because Folder is a type of File. In Translatable.php we have the following code:

$tab = $fields->findOrMakeTab('Root.Translations', _t('Translatable.TRANSLATIONS', 'Translations'));

The problem is Folder does not have a Root tab, so this line errors.

I have wrapped this section of code with a check to see if $fields has a tabset defined before trying to add tabs.

@3Dgoo 3Dgoo changed the title Check if object is folder before trying to add cms fields. Check if FieldList has tabset before trying to add cms fields to tabs. Jul 28, 2016
@dhensby
Copy link
Contributor

dhensby commented Jul 28, 2016

seems legit to me, would you mind squashing the 2 commits, please?

@3Dgoo
Copy link
Contributor Author

3Dgoo commented Aug 1, 2016

I have squashed the 2 commits together as requested.

@dhensby dhensby merged commit 0ae31a0 into silverstripe:2.2 Aug 1, 2016
@dhensby
Copy link
Contributor

dhensby commented Aug 1, 2016

thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants