Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion services/FetchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ public function elements($elementType, array &$sourceElements, $fieldHandles = n
// Attach the behavior to each of the source elements
foreach($sourceElementsById as $sourceElement)
{
$sourceElement->attachBehavior('fetched_elements', new Fetch_FetchedElementsBehavior());
// Make sure the behavior hasn't already been attached
if (!$sourceElement->asa('fetched_elements')) {
$sourceElement->attachBehavior('fetched_elements', new Fetch_FetchedElementsBehavior());
}
}

// Perform the first query to get the information from the craft_relations table
Expand Down