Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#1 | nodequeue.module-1777622.patch | 424 bytes | kenorb |
#3 | nodequeue.module-1777622.patch | 377 bytes | kenorb |
Comments
Comment #0.0
kenorb CreditAttribution: kenorb commentedadded additional sentence
Comment #1
kenorb CreditAttribution: kenorb commentedThis (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.
---
http://php.net/empty
Comment #1.0
kenorb CreditAttribution: kenorb commentedadded sentence
Comment #3
kenorb CreditAttribution: kenorb commentedPatch against the dev.
Comment #4
kenorb CreditAttribution: kenorb commentedVersion 6.x is no longer supported due to Drupal 6 End of Life.