Skip to content

Commit

Permalink
Just regex (#108)
Browse files Browse the repository at this point in the history
* add note to readme, extend in form, use latest version in composer.json

* comma

* Update utilities.inc
  • Loading branch information
flummingbird authored Feb 17, 2020
1 parent 8cb4ece commit 4050c8e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

[Twig Documentation] (http://twig.sensiolabs.org/documentation)


### Why Use Multi-importer
* UI driven integrated workflow for ingest and update
* Metadata Cleanup: Export your MODS metadata as CSV via Solr, clean up, then update the MODS datastream of the objects by recreating the MODS datastream using Twig
Expand All @@ -33,7 +32,8 @@
* To take advantage of the Twig Templating system for creating MODS from CSVs
* To preview the MODS output easily
* Supports integration with Google Spreadsheets, Zip/Local/Amazon storage and Complex storage needs via hooks.
* Added Jasny Pcre Extension. Twig templates can now support regular expressions. Be mindful of needing doubly escaped backslashes in situations that require regex with backslashes.

### Updating existing Objects
* To enable this functionality without any warnings you need to use https://github.com/mnylc/islandora_batch/tree/7.x-ISLANDORA-2046 instead of main Islandora Batch release. We are working on making those changes into the main release.
* Objects (PIDs) present in other Batch Sets won't be able to be updated because Islandora Batch only allows a single PID to exist in its DB. We are working on fixing that inside 7.x-ISLANDORA-2046. For now, please delete old batch sets if you plan on updating existing Objects that were ingested using Islandora Batch.
* Objects (PIDs) present in other Batch Sets won't be able to be updated because Islandora Batch only allows a single PID to exist in its DB. We are working on fixing that inside 7.x-ISLANDORA-2046. For now, please delete old batch sets if you plan on updating existing Objects that were ingested using Islandora Batch.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"react/http": "^0.4.1",
"phpoffice/phpexcel": "^1.8",
"google/apiclient": "^2.0",
"cache/filesystem-adapter": "^0.3.3"
"cache/filesystem-adapter": "^0.3.3",
"jasny/twig-extensions": "^1.3"
},
"authors": [
{
Expand Down
1 change: 1 addition & 0 deletions includes/import.form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ function islandora_multi_importer_twig_form($form, &$form_state, $file_data) {
'debug' => TRUE,
));
$twig->addExtension(new Twig_Extension_Debug());
$twig->addExtension(new Jasny\Twig\PcreExtension());

$validated = TRUE;
try {
Expand Down
3 changes: 2 additions & 1 deletion includes/utilities.inc
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ function islandora_multi_importer_twig_process(array $twig_input = array()) {
$twig = new \Twig_Environment($loader, array(
'cache' => drupal_realpath('private://'),
));

$twig->addExtension(new Jasny\Twig\PcreExtension());

//We won't validate here. We are here because our form did that
$output = $twig->render($twig_input['name'], $twig_input['data']);
//@todo catch anyway any twig error to avoid the worker to fail bad.
Expand Down

0 comments on commit 4050c8e

Please sign in to comment.