server icon indicating copy to clipboard operation
server copied to clipboard

fix: expect interface, not a specific implementation

Open blizzz opened this issue 2 years ago • 4 comments

  • Resolves: https://github.com/owncloud/music/issues/1068

Summary

  • fixes a regression when deleting folders while music app was enabled, for a LazyRoot was passed to this method.

Checklist

blizzz avatar Jun 02 '23 23:06 blizzz

Why is this slated for NC28? It's a regression that effects NC26 and 27.

JoshuaPettus avatar Jun 14 '23 18:06 JoshuaPettus

It's a regression that effects NC26 and 27.

And also NC25.

paulijar avatar Jun 14 '23 18:06 paulijar

Why is this slated for NC28? It's a regression that effects NC26 and 27.

For this PR is against the master branch. Backports would have the specific milestone of the next maintenance release assigned.

blizzz avatar Jun 15 '23 20:06 blizzz

ERROR: UndefinedInterfaceMethod - lib/private/Files/Node/Folder.php:347:24 - Method OCP\Files\IRootFolder::createNode does not exist (see https://psalm.dev/181)
                return [$this->root->createNode(

Wow, how did this even work, ever? createNode is protected.

To answer the question myself:

Objects of the same type will have access to each others private and protected members even though they are not the same instances. This is because the implementation specific details are already known when inside those objects.

phpdoc

blizzz avatar Jun 15 '23 22:06 blizzz

/backport to stable27

blizzz avatar Jun 23 '23 22:06 blizzz

/backport to stable26

blizzz avatar Jun 23 '23 22:06 blizzz

/backport to stable25

blizzz avatar Jun 23 '23 22:06 blizzz

The backport to stable25 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable25
git pull origin stable25

# Create the new backport branch
git checkout -b fix/foo-stable25

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

/backport to stable25

szaimen avatar Jun 23 '23 23:06 szaimen

The backport to stable25 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable25
git pull origin stable25

# Create the new backport branch
git checkout -b fix/foo-stable25

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport