Install

Works with Drupal: ^9.4 || ^10.2 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 416.75 KB
MD5: fbd72afb40ee435085075cc2aa1eaa6e
SHA-1: ff43a4e4264fca4f92de4ff14e99f25a2d7138da
SHA-256: b7b0ec267b86351db47eaf9aa89ac05d56d53b3216838cffb116f9b1653291d2
Download zip 580.32 KB
MD5: d8f91d3f7f11fbbb47ce62bf6399d00e
SHA-1: f2e0793b2ad7d6cbe6b1c655f5ec1f327f8376b3
SHA-256: 02b0e66fc0647a5227c6ce775d6d83fb0acb3c792886f858a6fe961e1e30604d

Release notes

## Summary

This release adds a complete JSON import pipeline for `special_night` nodes
inside the `beehotel_pricealterators` sub-module. Site builders can now
configure the import from the UI, while developers can run it via two new
Drush commands. A sample JSON fixture is included for testing.

## What's New

### JSON import for Special Nights

The Special Nights alterator now supports importing `special_night` nodes
from JSON files generated by external pricing tools (e.g. Airbnb scraping).

- New **"Import from JSON"** collapsible fieldset in the Special Nights
configuration form, with the following settings:
- Enable/disable the import.
- Source directory containing `*.json` files.
- Number of nights and adults (used by the scraper).
- Discount percentages for Airbnb and partner channels.
- Status of imported nodes (Published / Draft).
- Import is idempotent: existing nodes are matched by `field_nights.value`
(check-in date) and updated instead of duplicated.

### New Drush commands

Two commands are registered by `beehotel_pricealterators`:

- `drush bhpas:check` (alias `bhpas:status`)
Validates the configuration and prerequisites without writing to the
database. Exits with a non-zero code if the configuration is not ready,
making it suitable as a guard in cron jobs.

- `drush bhpas:import`
Imports or updates `special_night` nodes from the configured directory.
Options:
- `--dry-run`: show what would be created/updated.
- `--force`: run even if `import_enabled` is `FALSE`.
- `--source-dir`: override the configured directory for a single run.

### Sample JSON fixture

A reference JSON file is shipped in `tests/fixtures/special_night_2026-10-24.json`
and documented in `tests/fixtures/README.md`. It can be used to verify the
import pipeline without running the external scraper.

## For Site Builders

1. Go to **Configuration » BEE Hotel » Price Alterators » Special Nights**.
2. Expand **Import from JSON**.
3. Set the source directory to the folder containing the `*.json` files.
4. Adjust the discount percentages and node status as needed.
5. Save the form.
6. Run `drush bhpas:import` manually, or add it to cron.

**Recommended cron entry:**

```cron
10 */4 * * * cd /path/to/drupal && vendor/bin/drush bhpas:check && vendor/bin/drush bhpas:import

Created by: afagioli
Created on: 23 Oct 2026 at 16:01 UTC
Last updated: 23 Oct 2026 at 16:02 UTC
New features
Unsupported

Other releases