Problem/Motivation

A review of the module found errors in the entity definitions and some smaller bugs:

  1. The uid field of both entity types is an entity reference without a target type, so it points to nodes instead of users. The stored IDs are user IDs, set by the default value callback.
  2. Archive::label() reads $this->file->value, which is always empty for an entity reference. The label is empty, so the delete form asks "Are you sure you want to delete the Archive ?".
  3. Both entity types declare the storage_schema handler Drupal\earkiv\EntityStorageSchema, a class that does not exist.
  4. earkiv.info.yml does not depend on the File module, although archives are file entities.
  5. The page that deletes a schedule has the title "Delete archive".
  6. An invalid RRULE can be saved in the schedule form, and then the schedule list fails with an exception.

Proposed resolution

  1. Set the target type user on uid and update the installed field storage definitions in a post update function. The stored values do not change.
  2. Use the file name as the label of an archive, and "Archive job @id" when it has no file.
  3. Remove the storage_schema handler, so the default one is used, and update the installed entity type definitions.
  4. Add drupal:file to the dependencies.
  5. Give the schedule delete page the title "Delete schedule".
  6. Validate the RRULE in the schedule form, and show "Invalid rule" in the list instead of failing for a rule that is already saved.

Each fix is a separate commit in the merge request. Processing the schedules is handled in a separate issue.

Remaining tasks

  • Implement and test.
  • Review.

User interface changes

Archives have a label in the delete form. The schedule form shows an error for an invalid RRULE.

API changes

None.

Data model changes

The uid fields reference users. The storage_schema handler is removed. A post update function updates the installed definitions.

AI-Generated: Yes (Used Claude Code to review the module and draft this issue.)

Issue fork earkiv-3636927

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

thomas alsén created an issue. See original summary.

  • thomas alsén committed 40d7d6ac on 1.0.x
    fix: #3636927 Fix the entity definitions and validate schedule rules
    
thomas alsén’s picture

Status: Active » Fixed

Merged into 1.0.x!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.