[DDST-342, FDSF4-18] include title in field mapping#19
Conversation
particularly important for nodes that don't have field_title populated.
WalkthroughAdds Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant OAI as OAI Provider
participant Map as MetadataMap (DgiStandard/QDC)
participant FM as FieldMapping
participant XML as OAI XML Builder
Client->>OAI: Request record
OAI->>Map: Build metadata
Map->>FM: Resolve field mappings
rect rgba(200, 245, 200, 0.3)
note right of FM: New mapping
FM-->>Map: Map 'title' -> TITLE_ELEMENT_MAIN
end
Map->>XML: AddValues for title (main element)
alt DgiStandard
XML-->>OAI: dcterms:title populated
else QDC
XML-->>OAI: dc:title populated
end
OAI-->>Client: OAI record (with main title)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Plugin/OaiMetadataMap/DgiStandard.php (1)
54-55: Typo in element name breaks mapping'dcterms:contributer' is invalid; should be 'dcterms:contributor'. This will produce incorrect XML.
- 'field_organizations' => 'dcterms:contributer', + 'field_organizations' => 'dcterms:contributor',
🧹 Nitpick comments (1)
src/Plugin/OaiMetadataMap/DgiStandard.php (1)
576-582: Rename $optons → $options for clarityMinor rename for readability and to match common convention.
- protected function addPersistentUrl(ContentEntityInterface $entity, $dest, $alias) { - $optons = [ + protected function addPersistentUrl(ContentEntityInterface $entity, $dest, $alias) { + $options = [ 'absolute' => TRUE, 'alias' => $alias, ]; - $this->elements[$dest][] = $entity->toUrl('canonical', $optons)->toString(); + $this->elements[$dest][] = $entity->toUrl('canonical', $options)->toString();
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
src/Plugin/OaiMetadataMap/DgiStandard.php(1 hunks)src/Plugin/OaiMetadataMap/QDC.php(1 hunks)
🔇 Additional comments (3)
src/Plugin/OaiMetadataMap/QDC.php (1)
68-70: Add 'title' mapping (QDC) — LGTMCorrectly maps base "title" to dc:title; namespace is declared in METADATA_WRAPPER.
src/Plugin/OaiMetadataMap/DgiStandard.php (2)
39-41: Add 'title' mapping (DgiStandard) — LGTMCorrectly maps base "title" to dcterms:title.
395-426: Skip base “title” when title paragraphs exist
Pre-calculate whether any static::TITLE_PARAGRAPH_FIELDS are non-empty and viewable, and if so, continue past the base ‘title’ field to avoid emitting duplicate main titles. Please verify using an entity with both a base title and title paragraphs.
|
Going to close this in favor of another PR to come to retain the backwards compat behavior. |
particularly important for nodes that don't have field_title populated.
It seems this change was intended a while ago, but got lost in the shuffle, so including some related ticket IDs in the PR and putting this together now in hopes of getting this addressed sooner than later.
Summary by CodeRabbit