Skip to content

Commit

Permalink
Merge pull request #10 from discoverygarden/DDST_75
Browse files Browse the repository at this point in the history
DDST-75: Update README.md for community
  • Loading branch information
bibliophileaxe authored Apr 29, 2024
2 parents 765e0ca + 33ea7d2 commit d52da9e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
# Islandora Entity Status

![](https://github.com/discoverygarden/islandora_entity_status/actions/workflows/lint.yml/badge.svg)
![](https://github.com/discoverygarden/islandora_entity_status/actions/workflows/semver.yml/badge.svg)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

## Introduction

Cascades entity status to all referenced entities in an Islandora repository item

## Table of Contents

* [Features](#features)
* [Requirements](#requirements)
* [Installation](#installation)
* [Usage](#usage)
* [Troubleshooting/Issues](#troubleshootingissues)
* [Maintainers and Sponsors](#maintainers-and-sponsors)
* [Development/Contribution](#developmentcontribution)
* [License](#license)

## Features

Includes the command `islandora_entity_status:find-update-related-nodes` (aliased as `furnd`). This command will update a node's status and its related children's statuses in bulk.

It has two parameters:
- `nodes`: A comma-separated list of node IDs to be be processed.
- `status`: The status to be assigned to the nodes (0 or 1).

The module will maintain these status updates to their children through `node_update` and `media_presave` hooks. As well, the user will be alerted that their updates will cascade to their children when updating a node's status.

## Requirements

This module requires the following modules/libraries:
Expand All @@ -15,6 +41,12 @@ Install as usual, see
[this]( https://www.drupal.org/docs/extending-drupal/installing-modules) for
further information.

## Usage

```bash
drush islandora_entity_status:furnd --nodes="1,2,3" --status=1
```

## Troubleshooting/Issues

Having problems or solved a problem? Contact [discoverygarden](http://support.discoverygarden.ca).
Expand All @@ -23,9 +55,10 @@ Having problems or solved a problem? Contact [discoverygarden](http://support.di

This project has been sponsored by:

* Boston College
* [discoverygarden](http://wwww.discoverygarden.ca)

## Development
## Development/Contribution

If you would like to contribute to this module, please check out our helpful
[Documentation for Developers](https://github.com/Islandora/islandora/wiki#wiki-documentation-for-developers)
Expand Down
4 changes: 2 additions & 2 deletions islandora_entity_status.module
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function islandora_entity_status_node_update(EntityInterface $entity) {
}

// Trigger the batch process for collection node.
$node_ids_to_update = find_collection_nodes($nid);
$node_ids_to_update = islandora_entity_status_find_collection_nodes($nid);
$latestStatus = $entity->get('status')->value;

islandora_entity_status_trigger_batch_process($node_ids_to_update, $latestStatus);
Expand All @@ -78,7 +78,7 @@ function islandora_entity_status_form_node_islandora_object_edit_form_alter(&$fo
/**
* Find related nodes.
*/
function find_collection_nodes($currentNodeId) {
function islandora_entity_status_find_collection_nodes($currentNodeId) {
$relatedNodeIds = [];

// Initial query to find nodes where the field_member_of contains
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/BulkStatusCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Drupal\islandora_entity_status\Commands;

use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drush\Commands\DrushCommands;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drush\Commands\DrushCommands;

/**
* Drush command implementation.
Expand Down

0 comments on commit d52da9e

Please sign in to comment.