Permalink
Browse files

Fixed internal PodsUI callback issues in custom actions used by Pods

  • Loading branch information...
1 parent 0175694 commit b5bd76912023105857c91a59a6b6296e097b7438 @sc0ttkclark sc0ttkclark committed Oct 1, 2013
View
@@ -599,8 +599,8 @@ public function raw ( $name, $single = null ) {
* This function will return arrays for relationship and file fields.
*
* @param string|array $name The field name, or an associative array of parameters
- * @param boolean $single (optional) For tableless fields, to return the whole array or the just the first item
- * @param boolean $raw (optional) Whether to return the raw value, or to run through the field type's display method
+ * @param boolean $single (optional) For tableless fields, to return the whole array or the just the first item, or an associative array of parameters
+ * @param boolean $raw (optional) Whether to return the raw value, or to run through the field type's display method, or an associative array of parameters
*
* @return mixed|null Value returned depends on the field type, null if the field doesn't exist, false if no value returned for tableless fields
* @since 2.0
@@ -632,6 +632,10 @@ public function field ( $name, $single = null, $raw = false ) {
$defaults[ 'single' ] = null;
$params = (object) array_merge( $defaults, (array) $single );
}
+ elseif ( is_array( $raw ) || is_object( $raw ) ) {
+ $defaults[ 'raw' ] = false;
+ $params = (object) array_merge( $defaults, (array) $raw );
+ }
else
$params = (object) $defaults;
View
@@ -1588,7 +1588,7 @@ public function admin_setup_edit_field_options ( $pod ) {
*
* @return mixed
*/
- public function admin_setup_duplicate ( &$obj ) {
+ public function admin_setup_duplicate ( $obj ) {
$new_id = pods_api()->duplicate_pod( array( 'id' => $obj->id ) );
if ( 0 < $new_id )
@@ -1603,7 +1603,7 @@ public function admin_setup_duplicate ( &$obj ) {
*
* @return mixed
*/
- public function admin_setup_reset ( &$obj, $id ) {
+ public function admin_setup_reset ( $id, $obj ) {
$pod = pods_api()->load_pod( array( 'id' => $id ), false );
if ( empty( $pod ) )
@@ -1624,7 +1624,7 @@ public function admin_setup_reset ( &$obj, $id ) {
*
* @return mixed
*/
- public function admin_setup_delete ( $id, &$obj ) {
+ public function admin_setup_delete ( $id, $obj ) {
$pod = pods_api()->load_pod( array( 'id' => $id ), false );
if ( empty( $pod ) )
View
@@ -438,7 +438,7 @@ public function __construct ( $options, $deprecated = false ) {
}
if ( is_object( $object ) && ( 'Pods' == get_class( $object ) || 'Pod' == get_class( $object ) ) )
- $this->pod = &$object;
+ $this->pod =& $object;
}
if ( !is_array( $options ) ) {
@@ -170,7 +170,7 @@ function admin_edit ( $duplicate, $obj ) {
pods_view( PODS_DIR . 'components/Roles/ui/edit.php', compact( array_keys( get_defined_vars() ) ) );
}
- function admin_delete ( $id, &$obj ) {
+ function admin_delete ( $id, $obj ) {
global $wp_roles;
$id = $obj->id;
@@ -21,7 +21,7 @@ class Pods_Deprecated
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @since 2.0
*/
- public function __construct ( &$obj ) {
+ public function __construct ( $obj ) {
// backwards-compatibility with references to $this->var_name
$vars = get_object_vars( $obj );
@@ -24,7 +24,7 @@ class PodsAPI_Deprecated {
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @since 2.0
*/
- public function __construct ( &$obj ) {
+ public function __construct ( $obj ) {
// backwards-compatibility with references to $this->var_name
$vars = get_object_vars( $obj );
View
@@ -57,7 +57,7 @@ function pods_query ( $sql, $error = 'Database Error', $results_error = null, $n
* @since 2.0
* @todo Need to figure out how to handle $scope = 'pods' for the Pods class
*/
-function pods_do_hook ( $scope, $name, $args = null, &$obj = null ) {
+function pods_do_hook ( $scope, $name, $args = null, $obj = null ) {
// Add filter name
array_unshift( $args, "pods_{$scope}_{$name}" );

0 comments on commit b5bd769

Please sign in to comment.