Nodequeue breaking the whole SimpleTest instance when running the tests.

Backtest:

	NodequeueApacheSolrUnitTest->testNodequeueApacheSolrUpdateIndex( )
	nodequeue_apachesolr_update_index( $document = class stdClass { }, $node = class stdClass { public $nid = '1'; public $type = 'story'; public $language = ''; public $uid = '1'; public $status = '1'; public $created = '1347009452'; public $changed = '1347009452'; public $comment = '2'; public $promote = '1'; public $moderate = '0'; public $sticky = '0'; public $tnid = '0'; public $translate = '0'; public $vid = '1'; public $revision_uid = '1'; public $title = 's8124271ar7Kl19'; public $body = 's8124277oAQfWsrM9wQN2YzBow2x7h04AQaOGf7'; public $teaser = ''; public $log = ''; public $revision_timestamp = '1347009452'; public $format = '0'; public $name = 'placeholder-for-uid-1'; public $picture = ''; public $data = 'a:0:{}'; public $last_comment_timestamp = '1347009452'; public $last_comment_name = NULL; public $comment_count = '0'; public $taxonomy = array () } ) ../nodequeue.test:1068
Variables in local scope (#12)

$document =

	

&
object(stdClass)[976]

$key =

	

string 'sim_nodequeue' (length=13)

$node =

	

object(stdClass)[967]
  public 'nid' => string '1' (length=1)
  public 'type' => string 'story' (length=5)
...

$queues =

	

array
  1 => 
    object(stdClass)[836]
      public 'qid' => string '1' (length=1)
      public 'name' => string '' (length=0)
      public 'title' => string 's8124272zyfi2cf' (length=15)
      public 'subqueue_title' => string '' (length=0)
      public 'size' => string '4' (length=1)
      public 'link' => string 'Add to s8124272zyfi2cf' (length=22)
...

$sqid =

	

int 1

$subqueue =

	

object(stdClass)[961]
  public 'sqid' => string '1' (length=1)
  public 'qid' => string '1' (length=1)
  public 'reference' => string '1' (length=1)
  public 'title' => string 's8124272zyfi2cf' (length=15)
  public 'count' => string '4' (length=1)
  public 'position' => string '1' (length=1)

$subqueues =

	

array
  1 => 
    object(stdClass)[961]
      public 'sqid' => string '1' (length=1)
      public 'qid' => string '1' (length=1)
      public 'reference' => string '1' (length=1)
      public 'title' => string 's8124272zyfi2cf' (length=15)
      public 'count' => string '4' (length=1)
      public 'position' => string '1' (length=1)

So it seems empty document object is passed into nodequeue_apachesolr_update_index(), even there is condition to ignore the empty document object.

Related:
#710234: apachesolr_update_index gives error on null document

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kenorb’s picture

Issue summary: View changes

added additional sentence

kenorb’s picture

Version: 6.x-2.x-dev » 6.x-2.11
FileSize
424 bytes

This (count function) seems to be better approach to empty(), because empty() doesn't work for empty objects propertly.

See: http://stackoverflow.com/questions/1389431/how-to-check-if-object-is-emp...

Tested and now the test aren't failing anymore.

---

PHP > 5.0.0
Objects with no properties are no longer considered empty.

http://php.net/empty

kenorb’s picture

Issue summary: View changes

added sentence

Status: Active » Needs work

The last submitted patch, nodequeue.module-1777622.patch, failed testing.

kenorb’s picture

Version: 6.x-2.11 » 6.x-2.x-dev
Status: Needs work » Needs review
FileSize
377 bytes

Patch against the dev.

kenorb’s picture

Status: Needs review » Closed (outdated)

Version 6.x is no longer supported due to Drupal 6 End of Life.