Skip to content

Commit b38e649

Browse files
committed
Fixed ObjectState GW DoctrineDatabase::insertObjectState method
1 parent 00f4b25 commit b38e649

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/lib/Persistence/Legacy/Content/ObjectState/Gateway/DoctrineDatabase.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ public function insertObjectState(ObjectState $objectState, int $groupId): void
161161
{
162162
$maxPriority = $this->getMaxPriorityForObjectStatesInGroup($groupId);
163163

164-
$objectState->priority = $maxPriority === null ? 0 : (int)$maxPriority + 1;
165-
$objectState->groupId = (int)$groupId;
164+
$objectState->priority = $maxPriority === null ? 0 : $maxPriority + 1;
165+
$objectState->groupId = $groupId;
166166

167167
$query = $this->connection->createQueryBuilder();
168168
$query
@@ -208,7 +208,13 @@ public function insertObjectState(ObjectState $objectState, int $groupId): void
208208
if ($maxPriority === null) {
209209
$this->connection->executeStatement(
210210
'INSERT INTO ' . Gateway::OBJECT_STATE_LINK_TABLE . ' (contentobject_id, contentobject_state_id) ' .
211-
"SELECT id, $objectState->id FROM ibexa_content"
211+
'SELECT id, :object_state_id FROM ibexa_content',
212+
[
213+
'object_state_id' => $objectState->id,
214+
],
215+
[
216+
'object_state_id' => ParameterType::INTEGER,
217+
]
212218
);
213219
}
214220
}

0 commit comments

Comments
 (0)