- Issue created by @hoanglv
- Assigned to divyansh.gupta
- Merge request !51Issue #3484260: Handle Missing $data['invalidations'][0]. → (Open) created by divyansh.gupta
- 🇮🇳India divyansh.gupta Jaipur
Hello @hoanglv,
Applied your patch and the changes looks good to me because this can solve the error as by using reset($data['invalidations']), the code will check if there is at least one element in $data['invalidations'], regardless of the key structure.
Please review. The issue occurs when $data['invalidations'] doesn't have an element at index 0, causing the token replacement to fail. By using reset($data['invalidations']) instead of $data['invalidations'][0], we ensure the first element (or default value if the array is empty) is accessed correctly. This change resolves the issue and improves the robustness of the functionality.
So changes looks good to me so moving it to RTBC.
- Issue was unassigned.
- Status changed to Needs work
about 2 months ago 9:04pm 23 May 2025 - 🇨🇦Canada nkind
In trying this patch on our site with two servers it, for some reason, caused our purge cronjob to error with the following message:
Drupal\purge\Plugin\Purge\Purger\Exception\BadPluginBehaviorException: Only NOT_SUPPORTED, PROCESSING, SUCCEEDED and FAILED are valid outbound states. in Drupal\purge\Plugin\Purge\Invalidation\InvalidationBase->setStateContext()
Site is on 10.4.6 with all modules up to date.