Skip to content

Conversation

backportbot-nextcloud[bot]
Copy link

backport of #23034

TypeError: strpos() expects parameter 1 to be string, int given

The problem is that in cacheNode() we strip of any slashes, so
a folder "0/" will be trimmed to "0" and be used as an array key.
Since PHP automatically casts numeric array keys to integers,
you afterwards get $nodePath as int(0). Since it's now a number,
the strpos() function does not accept it anymore. Simply casting
$nodePath to a string again in the foreach solves the issue

Signed-off-by: Joas Schilling <coding@schilljs.com>
@faily-bot
Copy link

faily-bot bot commented Sep 25, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 33389: failure

samba

Show full log
There was 1 failure:

1) OCA\Files_External\Tests\Storage\SmbTest::testNotifyGetChanges
Actual changes are:
Array
(
    [0] => OC\Files\Notify\Change Object
        (
            [type:OC\Files\Notify\Change:private] => 1
            [path:OC\Files\Notify\Change:private] => newfile.txt
        )

    [1] => OC\Files\Notify\RenameChange Object
        (
            [targetPath:OC\Files\Notify\RenameChange:private] => renamed.txt
            [type:OC\Files\Notify\Change:private] => 4
            [path:OC\Files\Notify\Change:private] => newfile.txt
        )

    [2] => OC\Files\Notify\Change Object
        (
            [type:OC\Files\Notify\Change:private] => 2
            [path:OC\Files\Notify\Change:private] => renamed.txt
        )

)

Failed asserting that an array contains OC\Files\Notify\RenameChange Object &00000000408537f20000000042150d3a (
    'targetPath' => 'renamed.txt'
    'type' => 4
    'path' => 'newfile.txt'
).

/drone/src/apps/files_external/tests/Storage/SmbTest.php:126

mysql8.0-php7.2

Show full log
There were 2 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

--

There were 3 failures:

1) Test\Files\Cache\Wrapper\CacheJailTest::testWithoutNormalizer
Failed asserting that 0 is greater than 0.

/drone/src/tests/lib/Files/Cache/CacheTest.php:550

2) Test\Files\ObjectStore\ObjectStoreStorageTest::testWriteStream
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n
-Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n
-Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n
-Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
+''

/drone/src/tests/lib/Files/Storage/Storage.php:661

3) OCA\Files_Sharing\Tests\SharedMountTest::testPermissionMovedGroupShare with data set #51 ('folder', 5, 13)
Failed asserting that false is true.

/drone/src/apps/files_sharing/tests/SharedMountTest.php:366

@rullzer rullzer merged commit 93dbaed into stable19 Sep 28, 2020
@rullzer rullzer deleted the backport/23034/stable19 branch September 28, 2020 13:00
@rullzer rullzer mentioned this pull request Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants