MarcusBarnes / islandora_compound_batch

Provides the basic ability to batch import compound objects into Islandora.
GNU General Public License v3.0
3 stars 12 forks source link

Children not being ingested #10

Closed mjordan closed 7 years ago

mjordan commented 7 years ago

I'm using Compound Batch for the first time since the resolution of #2. Even though I've pulled in the latest code (I'm running at fde72039326d1d313927e3573e1628542ca75a25) and run drush devel-reinstall islandora_compound_batch so that the db gets updated, none of the children in my batch are being ingested. Only the parents are.

Here's the structure of the islandora_compound_batch table:

mysql> describe islandora_compound_batch;
+---------------------+---------------------+------+-----+---------+----------------+
| Field               | Type                | Null | Key | Default | Extra          |
+---------------------+---------------------+------+-----+---------+----------------+
| id                  | int(10) unsigned    | NO   | PRI | NULL    | auto_increment |
| child_content_value | text                | NO   |     | NULL    |                |
| object_id           | bigint(20) unsigned | NO   |     | 0       |                |
| object_xpath        | text                | NO   |     | NULL    |                |
| parent_xpath        | text                | NO   |     | NULL    |                |
| object_pid          | bigint(20) unsigned | NO   |     | 0       |                |
| parent_pid          | varchar(255)        | NO   |     |         |                |
| batch_id            | bigint(20) unsigned | NO   |     | 0       |                |
+---------------------+---------------------+------+-----+---------+----------------+
8 rows in set (0.00 sec)

Here's one of the compound object subdirectories in the input directory:

999/
├── 991
│   ├── MODS.xml
│   └── OBJ.jpg
├── 992
│   ├── MODS.xml
│   └── OBJ.jpg
├── 993
│   ├── MODS.xml
│   └── OBJ.jpg
├── 994
│   ├── MODS.xml
│   └── OBJ.jpg
├── 995
│   ├── MODS.xml
│   └── OBJ.jpg
├── 996
│   ├── MODS.xml
│   └── OBJ.jpg
├── 997
│   ├── MODS.xml
│   └── OBJ.jpg
├── 998
│   ├── MODS.xml
│   └── OBJ.jpg
├── MODS.xml
└── structure.xml

8 directories, 18 files

I've run create_structure_files.php over my input directory. Here's the strucutre.xml file for the input directory above:

<?xml version="1.0" encoding="utf-8"?>
<!--Islandora compound structure file used by the Compound Batch module. On batch ingest,
    'islandora_compound_object' elements become compound objects, and 'child' elements become their
    children. Files in directories named in child elements' 'content' attribute will be added as their
    datastreams. If 'islandora_compound_object' elements do not contain a MODS.xml file, the value of
    the 'title' attribute will be used as the parent's title/label.-->
<islandora_compound_object title="999">
  <child content="999/991"/>
  <child content="999/992"/>
  <child content="999/993"/>
  <child content="999/994"/>
  <child content="999/995"/>
  <child content="999/996"/>
  <child content="999/997"/>
  <child content="999/998"/>
</islandora_compound_object>

Anyone have any suggestions as to what I'm doing wrong? Won't somebody please think of the children? (Sorry, I couldn't resist that :laughing:)

MarcusBarnes commented 7 years ago

Is it possible to send me a few of the compound objects so that I can test batch ingest them in my local development environment?

mjordan commented 7 years ago

Sure, I'll send you a download link shortly. Thanks!

mjordan commented 7 years ago

Just tried ingesting 3 objects from my set into a clean Islandora Vagrant with the same results - the parents were ingested but none of the children.

MarcusBarnes commented 7 years ago

Thank you for double checking.

mjordan commented 7 years ago

@MarcusBarnes I found it. There's a typo in https://github.com/MarcusBarnes/islandora_compound_batch/blob/master/includes/utilities.inc#L22 (should be "jpg"), so https://github.com/MarcusBarnes/islandora_compound_batch/blob/master/includes/preprocessor.inc#L43 was returning FALSE.

We should also remove one of the duplicate lines 21 or 23.

I'll open a PR.

MarcusBarnes commented 7 years ago

@mjordan I'm glad that the issue has been isolated.

mjordan commented 7 years ago

Me too! PR is forthcoming, after I do one more round of testing.