Search by

faithcatholic / mass_times

nketchummjones

Mass Times entity.

Package info

github.com/FaithCatholic/mass_times

Language:Shell

Type:drupal-module

pkg:composer/faithcatholic/mass_times

Statistics

Installs: 1 420

Dependents: 1

Suggesters: 0

Stars: 1

Open Issues: 0

v4.0.0 2026-09-10 00:46 UTC

This package is auto-updated.

Last update: 2026-09-11 22:26:17 UTC


README

Defines a mass_times content entity for recording the service times of a parish: a name, a publishing status, an owner, and a set of shipped field storages for the parish, day of week, service type, start and end time, language, service id and a comment. Entities are managed under /admin/structure/mass_times and listed in an admin view at /admin/manage/masstimes. There is no front-end output; other modules or the site theme are expected to display the data.

Requirements

Drupal 10.3+ or 11, plus the following modules, all declared in the info.yml:

  • Diocesan Directory (custom, not on drupal.org): field_parish is an entity reference to its directory entity. Installing it pulls in Address and Field Group.
  • Core Field, Options, User and Views.

The module also assumes config that no module provides. These are the things that break a fresh install:

  • The roles administrator, diocesan_administrator and directory must exist. The shipped admin view (views.view.admin_masstimes) depends on them for access and the install fails without them.
  • Only field storages ship in config/install. The field instances (field.field.mass_times.mass_times.*), form display and view display are expected to come from the site's config sync. On a bare site the entity form shows only the base fields and the admin view columns are empty until those are created.

Installation

Install as usual at /admin/extend, or drush en mass_times. If the install fails on missing config dependencies, create the three roles above first.

Usage

  • /admin/structure/mass_times: collection of Mass times entities with add, edit and delete. Also linked from Content as "Mass Times", which points at the admin view.
  • /admin/structure/mass_times/settings: settings tab and the Field UI base route, so Manage fields and Manage display live here. The settings form itself has no options.
  • /admin/manage/masstimes: the "MassTimes Manager" view, restricted by role to administrator, diocesan_administrator and directory.
  • Help text at /admin/help/mass_times.

Permissions, all defined by the module: add, edit, delete, view published and view unpublished mass times entities, access the overview page, and administer mass times entities (the admin permission, restricted).

Development

The repo carries a DDEV setup based on ddev-drupal-contrib, drupal-contrib-extras, ddev-drupal and pimp-my-shell.

  • ddev start runs the bootstrap: poser fetches core and the dev dependencies from composer.json, installs the site, creates the two custom roles, enables devel and mass_times (which pulls in the Diocesan Directory chain) and prints a drush uli link. Admin credentials are admin / 1.
  • web/ and vendor/ are ignored; the module is symlinked file by file into web/modules/custom/mass_times. After adding or deleting a top-level file, run ddev symlink-project so the container sees it.
  • ddev phpcs and ddev phpcbf use the Drupal ruleset from phpcs.xml.dist.
  • ddev phpstan --level=6 -c ../../../../phpstan.neon runs PHPStan with the repo config. Plain ddev phpstan does not, because the add-on symlinks phpstan.neon into the module directory with a broken relative path and falls back to level 0 with no ignores.

Notes

  • The entity annotation still uses @ContentEntityType; converting it to a PHP attribute is pending and will be required before Drupal 12.
  • hook_help() lives in src/Hook/MassTimesHooks.php. The procedural stub in mass_times.module only exists for Drupal 10 and can be dropped once the floor is 11.1.
  • MassTimes::getOwnerId() returns an int as EntityOwnerInterface documents; on loaded entities the raw field value is a numeric string, so code comparing the result with === against a string id would need adjusting.