Skip to content

Commit ca5eab7

Browse files
committed
Fix: change variable name
1 parent a1a825c commit ca5eab7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/playground/data-liberation/src/import/WP_Stream_Importer.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ public function next_step() {
194194
if ( null !== $this->next_stage ) {
195195
return false;
196196
}
197+
198+
do_action( 'wp_stream_importer_next_stage', $this );
199+
197200
switch ( $this->stage ) {
198201
case self::STAGE_INITIAL:
199202
$this->next_stage = self::STAGE_INDEX_ENTITIES;
@@ -392,10 +395,11 @@ private function topological_sort_next_entity() {
392395
// $cursor = $this->entity_iterator->get_reentrancy_cursor();
393396
$entity = $this->entity_iterator->current();
394397
$data = $entity->get_data();
395-
$offset = $this->entity_iterator->get_entity_byte_offset();
398+
$offset = $this->entity_iterator->get_last_xml_byte_offset_outside_of_entity();
396399

397400
switch ( $entity->get_type() ) {
398401
case 'category':
402+
file_put_contents( 'php://stderr', print_r( $data, true ) );
399403
$this->topological_sorter->map_category( $offset, $data );
400404
break;
401405
case 'post':

packages/playground/data-liberation/src/wxr/WP_WXR_Reader.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ class WP_WXR_Reader implements Iterator {
340340
'wp:category' => array(
341341
'type' => 'category',
342342
'fields' => array(
343+
'wp:term_id' => 'term_id',
343344
'wp:category_nicename' => 'slug',
344345
'wp:category_parent' => 'parent',
345346
'wp:cat_name' => 'name',
@@ -396,8 +397,8 @@ protected function __construct( WP_XML_Processor $xml ) {
396397
$this->xml = $xml;
397398
}
398399

399-
public function get_entity_byte_offset() {
400-
return $this->entity_byte_offset;
400+
public function get_last_xml_byte_offset_outside_of_entity() {
401+
return $this->last_xml_byte_offset_outside_of_entity;
401402
}
402403

403404
public function get_reentrancy_cursor() {

0 commit comments

Comments
 (0)