fix: #3636927 Fix the entity definitions and validate schedule rules

Closes https://www.drupal.org/project/earkiv/issues/3636927

One commit per item.

Commits

  1. Let the author fields reference users. uid on archives and schedules gets the target type user. earkiv_post_update_author_references_users() updates the installed field storage definitions; the stored user IDs do not change and the column type is the same.
  2. Give archives a label. The file name, "Archive job @id" before the archive exists, and "New archive job" for an unsaved entity. The delete form asked to delete "the Archive " before.
  3. Remove the storage schema handler that pointed to a missing class. earkiv_post_update_remove_storage_schema_handler() updates the installed entity type definitions.
  4. Depend on the File module.
  5. Give the schedule delete page its own title.
  6. Validate schedule rules. The schedule form validates the RRULE with RRule::createFromRfcString(), and the schedule list shows "Invalid rule: …" for a rule that is already saved and invalid instead of failing.

Testing

  • After drush updatedb, the installed uid definitions of both entity types have the target type user, the storage_schema handler is gone, and entityDefinitionUpdateManager()->needsUpdates() is FALSE. The author of an existing archive loads as a user.
  • The delete form of an archive asks to delete earkiv_67_….tar.gz.
  • FREQ=WEEKLY;BYDAY=SU;BYHOUR=2 is accepted; FREQ=SOMETIMES and hej are refused with the message from the library. With an invalid rule saved directly, the schedule list loads and shows "Invalid rule: FREQ=SOMETIMES".
  • phpcs (Drupal, DrupalPractice) reports no new findings caused by the changes.

AI-Generated: Yes (Used Claude Code to write the fixes, test them and write this merge request.)

Merge request reports

Loading
Loading