Multiple values

andypost - March 10, 2009 - 19:47
Project:NodeReferrer
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

If anyone can help to decide - which is right?

<?php
/**
* Implementation of hook_widget_info().
*/
function nodereferrer_widget_info() {
  return array(
   
'nodereferrer_list' => array(
     
'label' => t('Read-Only List'),
     
'field types' => array('nodereferrer'),
-     
'multiple values' => CONTENT_HANDLE_MODULE,
+     
'multiple values' => CONTENT_HANDLE_CORE,
     
'callbacks' => array(
       
'default value' => CONTENT_CALLBACK_NONE,
       ),
    ),
  );
}
?>

<?php
/**
* Implementation of hook_content_is_empty
*/
function nodereferrer_content_is_empty($item, $field) {
-  return
FALSE;
+  return
TRUE;
}

?>

#1

Aren Cambre - March 22, 2009 - 22:05

On #2, are you fixing content_is_empty to one or the other because it is arbitrary and useless for this module?

#2

andypost - March 25, 2009 - 23:08

I dont know exactly - docs tell me nothing

#3

scroogie - March 30, 2009 - 22:46

Regarding the multiple values I think in this case it doesn't matter, because its not displayed in the form, but to be save I would define it as CONTENT_HANDLE_MODULE.

In the second function, if you always return TRUE, the field should theoretically always save NULL. I think it should make no difference neither, but computed_field always return false.

#4

kenorb - April 2, 2009 - 14:08

#5

andypost - April 2, 2009 - 14:57

So I leave first sentence as is but second should change to

<?php
return TRUE;
?>

I make this changes at next commit

#6

andypost - April 9, 2009 - 14:45
Status:postponed (maintainer needs more info)» fixed

Fixed http://drupal.org/cvs?commit=194918

So removed multiple setting because is not needed

#7

System Message - April 23, 2009 - 14:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.