This line is checking if route names contain document_ anywhere in them. In one project I had the route app_order_document_preview, which of course didn't contain a contentDocument key in the request. Because of that the restriction status check failed with the error:
Argument 1 passed to MembersBundle\Manager\RestrictionManager::getElementRestrictionStatus() must be an instance of Pimcore\Model\AbstractModel, null given
With this PR the check explicitly checks if the string begins with document_.
This line is checking if route names contain
document_
anywhere in them. In one project I had the routeapp_order_document_preview
, which of course didn't contain acontentDocument
key in the request. Because of that the restriction status check failed with the error:With this PR the check explicitly checks if the string begins with
document_
.