Skip to content

Commit

Permalink
extending field and checking for object before iterating
Browse files Browse the repository at this point in the history
  • Loading branch information
IAMlKeno committed Apr 14, 2021
1 parent 43ed550 commit 84f3094
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 5 additions & 3 deletions includes/solr_results.inc
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,11 @@ function islandora_xquery_run_query_batch_operation(array $dsids, $object_range,
// Run the find/replace on all applicable datastreams.
$current_object = islandora_xquery_run_query_batch_operation_get_object($context);

foreach ($current_object as $datastream) {
if (array_intersect($dsids, array($datastream->id))) {
islandora_xquery_run_query_batch_operation_generate_diff($current_object, $datastream, $xquery, $context);
if (is_object($current_object)) {
foreach ($current_object as $datastream) {
if (array_intersect($dsids, array($datastream->id))) {
islandora_xquery_run_query_batch_operation_generate_diff($current_object, $datastream, $xquery, $context);
}
}
}

Expand Down
14 changes: 14 additions & 0 deletions islandora_xquery.install
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,17 @@ function islandora_xquery_update_7102() {
'not null' => TRUE,
));
}

/**
* Implements hook_update_N().
*
* Updates xquery diff field to use big blobs.
*/
function islandora_xquery_update_7103() {
db_change_field('islandora_xquery_diffs', 'diff', 'diff', array(
'description' => "Diff after find/replace.",
'type' => 'blob',
'size' => 'big',
'not null' => TRUE,
));
}

0 comments on commit 84f3094

Please sign in to comment.