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

BUGFIX: Fixed issue #213 causing crash when accessing a translation with a checkbox #215

Merged
merged 1 commit into from
Jan 13, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/model/Translatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,7 @@ public function transformFormField(FormField $field) {
* @param FormField $originalField The original editable field containing the translated value
* @return CheckboxField The field with a modified label
*/
protected function transformCheckboxField(CheckboxField $nonEditableField, CheckboxField $originalField) {
protected function transformCheckboxField(CheckboxField_Readonly $nonEditableField, CheckboxField $originalField) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we have the inverse errorwhen a non-readonly CheckboxField is passed in. If using a strict typehint it should match the phpdoc (or alter the phpdoc).

I suggest to just make it FormField.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this parameter even used? It doesn't seem to be even referenced inside the method body.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya i don't think it is, probably only there for compatibility.

$label = $originalField->Title();
$fieldName = $originalField->getName();
$value = ($this->original->$fieldName)
Expand Down