Install
Works with Drupal: ^9.4 || ^10.2 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Summary
-------
This release adds a JSON import pipeline for special_night nodes and
fixes a date range matching bug in the SpecialNights Price Alterator
that caused special prices to be silently ignored.
New features
------------
- JSON import for Special Nights.
Two Drush commands are now available:
- drush bhpas:check
Validates the configuration and prerequisites without writing to
the database.
- drush bhpas:import
Creates or updates special_night nodes from JSON files, matching
on the (field_nights.value, field_room.target_id) pair. Supports
--dry-run, --force and --source-dir options.
The import is idempotent: running it multiple times updates the
existing nodes instead of creating duplicates.
- New configuration fieldset "Import from JSON" in the Special Nights
alterator settings, exposing the source directory, nights/adults,
primary and secondary channel discounts, and imported node status.
- Sample JSON fixture at tests/fixtures/special_night_example.json,
with a format reference in tests/fixtures/README.md.
Bug fixes
---------
- Fixed: the SpecialNights plugin did not match nodes whose check-in
was stored at 23:00 and check-out at 22:59, because the query
compared against T00:00:00 and T23:59:59. As a result, special
prices were never applied to the room calendar. The date range
conditions have been corrected.
Upgrade notes
-------------
No database updates are required. After updating the codebase:
drush cr
drush bhpas:check
If you were already using a previous import implementation, open the
"Import from JSON" fieldset in the Special Nights form and re-save it
to migrate the configuration keys to their new names
(import_discount_primary, import_discount_secondary).
Full changelog
--------------
- Added: bhpas:check and bhpas:import Drush commands.
- Added: "Import from JSON" fieldset in the Special Nights form.
- Added: tests/fixtures/special_night_example.json sample fixture.
- Added: tests/fixtures/README.md format documentation.
- Fixed: SpecialNights plugin date range matching conditions.
- Changed: module strings translated to English.
- Changed: Drush commands moved to src/Drush/Commands/ (Drush 13).
- Removed: drush.services.yml.