Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion app/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,7 @@
</type>
<type name="Magento\Framework\Webapi\ServiceInputProcessor">
<arguments>
<argument name="defaultPageSize" xsi:type="number">999999</argument>
<argument name="defaultPageSize" xsi:type="number">20</argument>
</arguments>
</type>
<preference for="Magento\Framework\App\BackpressureEnforcerInterface"
Expand Down
14 changes: 11 additions & 3 deletions lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Magento\Framework\Webapi\CustomAttribute\PreprocessorInterface;
use Laminas\Code\Reflection\ClassReflection;
use Magento\Framework\Webapi\Validator\IOLimit\DefaultPageSizeSetter;
use Magento\Framework\Webapi\Validator\IOLimit\IOLimitConfigProvider;
use Magento\Framework\Webapi\Validator\ServiceInputValidatorInterface;

/**
Expand Down Expand Up @@ -128,6 +129,7 @@ public function __construct(
AttributeValueFactory $attributeValueFactory,
CustomAttributeTypeLocatorInterface $customAttributeTypeLocator,
MethodsMap $methodsMap,
IOLimitConfigProvider $validationConfigProvider,
ServiceTypeToEntityTypeMap $serviceTypeToEntityTypeMap = null,
ConfigInterface $config = null,
array $customAttributePreprocessors = [],
Expand All @@ -140,6 +142,7 @@ public function __construct(
$this->attributeValueFactory = $attributeValueFactory;
$this->customAttributeTypeLocator = $customAttributeTypeLocator;
$this->methodsMap = $methodsMap;
$this->validationConfigProvider = $validationConfigProvider;
$this->serviceTypeToEntityTypeMap = $serviceTypeToEntityTypeMap
?: ObjectManager::getInstance()->get(ServiceTypeToEntityTypeMap::class);
$this->config = $config
Expand Down Expand Up @@ -328,9 +331,14 @@ protected function _createFromArray($className, $data)
}
}

if ($object instanceof SearchCriteriaInterface) {
$this->defaultPageSizeSetter->processSearchCriteria($object, $this->defaultPageSize);
}
if ($object instanceof SearchCriteriaInterface)
if($object->getPageSize() === null && $this->validationConfigProvider->isInputLimitingEnabled()
) {
$object->setPageSize( $this->validationConfigProvider->getDefaultPageSize());
}
else {
$object->setPageSize($this->defaultPageSize);
}

return $object;
}
Expand Down