Details
return $this->connection->fetchColumn($sql, $params);
}
/** @return array|false */
private function doFetchAssociative(string $sql, array $params)
{
if (method_exists($this->connection, 'fetchAssociative')) {
return $this->connection->fetchAssociative($sql, $params);
}
return $this->connection->fetchAssoc($sql, $params);
}
/** @return array[] */
private function doFetchAllAssociative(string $sql, array $params): array
{
if (method_exists($this->connection, 'fetchAllAssociative')) {
return $this->connection->fetchAllAssociative($sql, $params);
}
return $this->connection->fetchAll($sql, $params);
}
}
#### Step 2. Register the service
**Option A:** If your app uses autowiring and supports the `#[AsDecorator]` attribute, uncomment it in the class and no further configuration is necessary.
**Option B:** Manually register the service in `config/services.yaml`:
```yaml
services:
App\Modifier\AtomicOrderPromotionsUsageModifier:
decorates: 'sylius.promotion_usage_modifier'
arguments: ['@doctrine.dbal.default_connection']
Step 3. Update exception mapping (optional)
Check if your api_platform configuration maps OptimisticLockException to a code and update it if not:
api_platform:
...
exception_to_status:
...
Doctrine\ORM\OptimisticLockException: 409
Step 4. Clear cache
bin/console cache:clear
Reporters
We would like to extend our gratitude to the following individuals for their detailed reporting and responsible disclosure of this vulnerability:
- Djibril Mounkoro (@whiteov3rflow)
- Bartłomiej Nowiński (@bnBart)
For more information
If you have any questions or comments about this advisory:
- Open an issue in Sylius issues
- Email us at [[email protected]](mailto:[email protected])