Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDST-75: Update README.md for community #10

Merged
merged 4 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading