- πΊπΈUnited States rymcveigh
Thank you for documenting this. It helped us resolve the same issue with a custom module.
- π¨π΄Colombia jasonac91
None of this works, with any version after 4.1.0
- π¨π΄Colombia jasonac91
This patch addresses an issue where the access() method could potentially return a boolean instead of an expected AccessResult object in the ViewsBulkOperationsActionProcessor class. This was causing a fatal error ("Call to a member function isAllowed() on bool") when attempting to call isAllowed() on what was assumed to be an AccessResult object but was actually a boolean value.
The provided solution adds a check to ensure that the $accessResult variable is indeed an object and specifically that it possesses the isAllowed() method before attempting to call it. This check prevents the fatal error by verifying the type and method existence:
The patch first checks if $accessResult is an object and if it has the method isAllowed using PHP's is_object() and method_exists().
If these checks pass, it processes to verify if the access is allowed.
If $accessResult is not an object or does not have the isAllowed() method, it logs an error stating that the access result is not a valid AccessResult object. This helps in identifying configuration or code issues that might be causing unexpected return types.
By implementing this, we ensure the robustness of the process() function in handling cases where the action might not adhere to the expected return type conventions. This change is crucial for maintaining the stability and reliability of bulk operations within Views Bulk Operations, especially in complex environments where different actions might be configured to return non-standard access results.This patch is attached for review and testing. It has been tested in my local environment where the issue was replicated and verified that the patch resolves the problem without affecting the existing functionalities.