Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix(dav): intersect CalDAV shares by principal without array-to-string warnings - #65239

Closed
whoalin1 wants to merge 2 commits into
nextcloud:masterfrom
whoalin1:fix/dav-intersect-shares-by-principal-v2
Closed

whoalin1 wants to merge 2 commits into
nextcloud:masterfrom
whoalin1:fix/dav-intersect-shares-by-principal-v2

Conversation

@whoalin1

@whoalin1 whoalin1 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #37025

Moving a calendar object between calendars that have share entries triggered PHP warnings:

Array to string conversion at apps/dav/lib/CalDAV/Activity/Backend.php

onMovedCalendarObject() used array_intersect() on nested share arrays. PHP casts each member to string ("Array"), which emits the warning and does not reliably compute the shared-principal intersection.

Fix

  • Add intersectSharesByPrincipal() that intersects by {http://owncloud.org/ns}principal and preserves the source share entry.
  • Use it from onMovedCalendarObject() before getUsersForShares().
  • Unit coverage for empty / disjoint / overlapping share lists.

Test plan

  • Move an event between two calendars that share at least one principal → no PHP warning; activity still published for common sharees + owner
  • Move between calendars with no common sharees → no warning; owner still notified
  • apps/dav/tests/unit/CalDAV/Activity/BackendTest.php — testIntersectSharesByPrincipal

AI disclosure

This PR was drafted with the help of AI coding assistants (Cursor agents / LLM-based tools), including the description. I am responsible for it and happy to rework anything that doesn't fit.

All commits carry an Assisted-by: Cursor:grok-4.7 trailer.

…g warnings

Assisted-by: Cursor:grok-4.7
Signed-off-by: whoalin1 <whoalin414@gmail.com>
Assisted-by: Cursor:grok-4.7
Signed-off-by: whoalin1 <whoalin414@gmail.com>
@whoalin1
whoalin1 force-pushed the fix/dav-intersect-shares-by-principal-v2 branch from 4ccc0d8 to 6bb9d7b Compare October 9, 2026 14:11
@SebastianKrupinski SebastianKrupinski self-assigned this Oct 13, 2026
@SebastianKrupinski

Copy link
Copy Markdown
Contributor

Hi @whoalin1

Thanks for the PR. But I think there might be a simpler fix to this.

#65478

@SebastianKrupinski

Copy link
Copy Markdown
Contributor

Closing this in favour of #65478

@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked because it has been closed for more than 7 days. As we do not monitor merged or closed pull requests, we are locking this pull request to prevent further comments from getting lost in the noise.
If you discovered any issues with this pull request, please open a new issue instead. In case you want to discuss this pull request or have further questions, please use our forum: https://help.nextcloud.com

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Array to string conversion in CalDAV backend

2 participants