microsoftgraph / microsoftgraph/msgraph-sdk-php

Conflict Behavior cannot be set for Drive Item Copy

オープン
#1,555 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

dependency:metadata type:bug
主要言語
PHP
スター
669
フォーク
150
平均マージ
15時間 21分
マージ済み PR(30日)
3

説明

Describe the bug

I try to copy a file from folder A to folder B and I try to use @microsoft.graph.conflictBehavior but the request does not allow query parameters and it doesn't work if I add it to the body.

Expected behavior

I expected CopyRequestBuilderPostRequestConfiguration to have query options. Or for the CopyPostRequestBody->setAdditionalData(['@microsoft.graph.conflictBehavior' => 'rename']) to work.

How to reproduce
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Drives\Item\Items\Item\Copy\CopyPostRequestBody;
use Microsoft\Graph\Generated\Models\ItemReference;


$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);

$requestBody = new CopyPostRequestBody();
$parentReference = new ItemReference();
$parentReference->setDriveId('6F7D00BF-FC4D-4E62-9769-6AEA81F3A21B');
$parentReference->setId('DCD0D3AD-8989-4F23-A5A2-2C086050513F');
$requestBody->setParentReference($parentReference);
$requestBody->setAdditionalData(['@microsoft.graph.conflictBehavior' => 'rename']);

$result = $graphServiceClient->drives()->byDriveId('drive-id')->items()->byDriveItemId('driveItem-id')->copy()->post($requestBody)->wait();

When there is already a file in the destination folder with the same name it doesn't do anything instead of renaming the new file.

SDK Version

2.10.0

Latest version known to work for scenario above?

1.110.0

Known Workarounds

No response

Debug output

No response

Configuration

No response

Other information

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

生成された CopyRequestBuilderPostRequestConfiguration クラスと CopyPostRequestBody クラスから始め、issue にある再現リクエストを使用します。SDK バージョン 2.10.0 と 1.110.0 でコピーリクエストの動作を比較し、conflictBehavior=rename が受け入れられ、競合する宛先ファイルの名前が変更されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
api
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。