Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

FIX: Strict error warnings on DataExtension #1156

Merged
merged 2 commits into from

2 participants

@mandrew

PHP is throwing strict error warnings when overriding the updateCMSFields and other functions in custom DataExtensions due to the fact that the abstract class doesn't declare that the variables should be passed by reference

mandrew added some commits
@mandrew mandrew FIX: Strict error warnings on DataExtension
PHP is throwing strict error warnings when overriding the
updateCMSFields and other functions in custom DataExtensions due to
the fact that the abstract class doesn't declare the variables should
be passed by reference
1960df8
@mandrew mandrew FIX: validate doesn't take var by reference
Got a bit carried away, validate doesn't take the var by reference
866bb07
@chillu
Owner

Thanks Mike! :)

@chillu chillu merged commit 5205a44 into from
@mandrew mandrew deleted the branch
@mandrew mandrew referenced this pull request in silverstripe/silverstripe-cms
Merged

FIX: updateCMSFields not accepting var by reference #284

@chillu
Owner

Reverted in accbd7f actually.
@ajshort has changed the method signatures in 1f6f7f0. While it wasn't explicitly noted in the commit message, I think its a good change - objects like a FieldList are always passed by reference in PHP, no need to declare that behaviour.
It should've been noted as an API change, but in the end we have a better API now, and any custom code needs to adjust for that.

@sminnee sminnee referenced this pull request from a commit in sminnee/silverstripe-cms
@mandrew mandrew FIX: updateCMSFields not accepting var by reference
updateCMSFields should be taking the fields var by reference.
@see silverstripe/silverstripe-framework#1156
e56a78b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 4, 2013
  1. @mandrew

    FIX: Strict error warnings on DataExtension

    mandrew authored
    PHP is throwing strict error warnings when overriding the
    updateCMSFields and other functions in custom DataExtensions due to
    the fact that the abstract class doesn't declare the variables should
    be passed by reference
  2. @mandrew

    FIX: validate doesn't take var by reference

    mandrew authored
    Got a bit carried away, validate doesn't take the var by reference
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 model/DataExtension.php
View
6 model/DataExtension.php
@@ -145,7 +145,7 @@ public function extraStatics($class = null, $extension = null) {
*
* @param FieldList $fields FieldList with a contained TabSet
*/
- public function updateCMSFields(FieldList $fields) {
+ public function updateCMSFields(FieldList &$fields) {
}
/**
@@ -156,7 +156,7 @@ public function updateCMSFields(FieldList $fields) {
*
* @param FieldList $fields FieldList without TabSet nesting
*/
- public function updateFrontEndFields(FieldList $fields) {
+ public function updateFrontEndFields(FieldList &$fields) {
}
/**
@@ -165,7 +165,7 @@ public function updateFrontEndFields(FieldList $fields) {
*
* @param FieldList $actions FieldList
*/
- public function updateCMSActions(FieldList $actions) {
+ public function updateCMSActions(FieldList &$actions) {
}
/**
Something went wrong with that request. Please try again.