| | | | |
The Caption will use the Drupal Title field.
The identifier will move to a dedicated field.
---
Resulting Data Structure
Asset entity fields:
Caption (Drupal Title field)
Code (field_as_code)
Counter
Chapter
Place / Organisation
Media
OriginalFileName
Description
Notes
Media entity fields:
Name (caption)
File
Metadata
Relationship:
Asset
→ Media
→ File
Example Asset:
Code: CH03-OOSTEN-00007
Caption: Construction of harbour bridge
Description: Photograph taken during installation of steel beams...
---
Proposed Ingestion Workflow
New workflow:
Upload file
↓
Enter Media Name (caption)
↓
Create Asset
↓
System copies Media Name → Asset Caption
↓
System generates Code
The caption is therefore entered once during media upload.
---
Behaviour Rules
1. Media Name must be mandatory.
2. Caption is automatically populated when the Asset is created.
3. Caption is copied only during initial creation.
4. Later edits of Media must not overwrite the Caption.
5. Users may edit the Caption afterwards.
6. The Code field is system-generated and immutable.
---
Migration Strategy
The current system already includes:
- Asset entity
- Media upload
- automatic identifier generation
- automatic filename capture
The following steps migrate the system to the new model.
---
Step 1 — Rename the Title Label
Location:
Structure → Content types → Asset → Edit
Change the Title label from:
Code
to:
Caption
The internal machine name remains:
title
Existing values remain unchanged.
---
Step 2 — Create the Code Field
Add a new field to the Asset content type.
Configuration:
Label: Code
Machine name: field_as_code
Type: Text (plain)
Cardinality: 1
Required: No
This field will contain the archival identifier.
---
Step 3 — Adjust the Custom Module
Modify the automation module.
Old behaviour:
$entity->setTitle($identifier);
New behaviour:
$entity->set('field_as_code', $identifier);
All other logic remains unchanged:
- counter generation
- filename extraction
- immutability rules
---
For each Media type:
Structure → Media types → [Media type] → Manage fields
Edit the field:
Name
Enable:
Required
Media types to update:
- Image
- Document
- Video
- Audio
---
Extend the custom module with logic:
If Asset is new AND Caption empty
read Media Name
copy Media Name → Caption
This ensures the Caption is filled automatically.
---
Reorganize the Asset form fields:
Media
Chapter
Place / Organisation
Caption
Description
Notes
Hide system fields:
Counter
Code
OriginalFileName
---
Step 7 — Adjust Dashboard Views
Update Asset dashboards to display:
Code
Caption
Chapter
Context
This keeps Assets recognizable in listings.
---
Step 8 — Validate Existing Records
After implementation verify:
- Code field populated correctly
- Caption preserved
- Identifier generation working
- Media linkage unaffected
No database migration is required because the Title field is only relabelled.
---
Advantages
The refactoring provides:
- simplified ingestion workflow
- elimination of duplicate typing
- clearer conceptual model
- improved usability for non-technical contributors
- better alignment with archival cataloguing practice
---
Risks and Side Effects
Possible side effects include:
- Views displaying the old Title label
- dashboards requiring field replacement
- module references still pointing to Title
- form display requiring adjustment
All should be verified after implementation.
---
Compliance with Project Blueprint
The proposal respects the architectural principles:
- Asset remains the authoritative record
- Media remains the file container
- File remains the physical storage object
Automation assists data entry but does not change the authority model.
---
Status
Proposed design change.
Implementation to be executed in controlled steps after validation.
|