Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] PHP 8.1 compatibility #887

Closed
rosiel opened this issue Jul 21, 2022 · 7 comments
Closed

[BUG] PHP 8.1 compatibility #887

rosiel opened this issue Jul 21, 2022 · 7 comments

Comments

@rosiel
Copy link
Member

rosiel commented Jul 21, 2022

Automated tests fail on PHP 8.1. Example.

1 - Stomp is not 8.1 compatible. This is a known issue.
2 - During our JsonldTypeAlterReactionTest, NULL gets sent to mb_strtolower() and that's deprecated in 8.1. My attempt to parse the error is that we try to compile() a Drupal\Core\Config\Entity\Query\Condition with $condition['value'] of NULL?

PHPUnit 9.5.21 #StandWithUkraine
Runtime:       PHP 8.1.8
Configuration: /opt/drupal/web/core/phpunit.xml
Testing 
......E....E..E......                                             21 / 21 (100%)
Time: 17:28.178, Memory: 16.00 MB
There were 3 errors:

1) Drupal\Tests\islandora\Functional\EmitNodeEventTest::testEmitEvent
Exception: Deprecated function: Return type of Stomp\Transport\Frame::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
include()() (Line: 19)

/opt/drupal/web/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:49
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:204
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:153
/opt/drupal/vendor/guzzlehttp/promises/src/TaskQueue.php:48
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:248
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:224
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:269
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:226
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:62
/opt/drupal/vendor/guzzlehttp/guzzle/src/Client.php:182
/opt/drupal/web/core/tests/Drupal/Tests/DrupalTestBrowser.php:137
/opt/drupal/vendor/symfony/browser-kit/Client.php:404
/opt/drupal/vendor/symfony/browser-kit/Client.php:324
/opt/drupal/vendor/friends-of-behat/mink-browserkit-driver/src/BrowserKitDriver.php:719
/opt/drupal/vendor/friends-of-behat/mink-browserkit-driver/src/BrowserKitDriver.php:494
/opt/drupal/vendor/behat/mink/src/Element/NodeElement.php:153
/opt/drupal/vendor/behat/mink/src/Element/NodeElement.php:161
/opt/drupal/web/core/tests/Drupal/Tests/UiHelperTrait.php:100
/opt/drupal/web/core/tests/Drupal/Tests/UiHelperTrait.php:216
/home/runner/work/islandora/islandora/build_dir/tests/src/Functional/IslandoraFunctionalTestBase.php:315
/home/runner/work/islandora/islandora/build_dir/tests/src/Functional/EmitNodeEventTest.php:53
/opt/drupal/vendor/phpunit/phpunit/src/Framework/TestResult.php:726

2) Drupal\Tests\islandora\Functional\IslandoraSettingsFormTest::testJwtExpiry
Exception: Deprecated function: Return type of Stomp\States\Meta\SubscriptionList::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
include()() (Line: 23)

/opt/drupal/web/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:49
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:204
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:153
/opt/drupal/vendor/guzzlehttp/promises/src/TaskQueue.php:48
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:248
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:224
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:269
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:226
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:62
/opt/drupal/vendor/guzzlehttp/guzzle/src/Client.php:182
/opt/drupal/web/core/tests/Drupal/Tests/DrupalTestBrowser.php:137
/opt/drupal/vendor/symfony/browser-kit/Client.php:404
/opt/drupal/vendor/symfony/browser-kit/Client.php:324
/opt/drupal/vendor/friends-of-behat/mink-browserkit-driver/src/BrowserKitDriver.php:719
/opt/drupal/vendor/friends-of-behat/mink-browserkit-driver/src/BrowserKitDriver.php:494
/opt/drupal/vendor/behat/mink/src/Element/NodeElement.php:153
/opt/drupal/vendor/behat/mink/src/Element/NodeElement.php:161
/opt/drupal/web/core/tests/Drupal/Tests/UiHelperTrait.php:100
/opt/drupal/web/core/tests/Drupal/Tests/UiHelperTrait.php:216
/home/runner/work/islandora/islandora/build_dir/tests/src/Functional/IslandoraSettingsFormTest.php:40
/opt/drupal/vendor/phpunit/phpunit/src/Framework/TestResult.php:726

3) Drupal\Tests\islandora\Functional\JsonldTypeAlterReactionTest::testMappingReaction
Exception: Deprecated function: mb_strtolower(): Passing null to parameter #1 ($string) of type string is deprecated
Drupal\Core\Config\Entity\Query\Condition->compile()() (Line: 39)

/opt/drupal/web/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:49
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:204
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:153
/opt/drupal/vendor/guzzlehttp/promises/src/TaskQueue.php:48
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:248
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:224
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:269
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:226
/opt/drupal/vendor/guzzlehttp/promises/src/Promise.php:62
/opt/drupal/vendor/guzzlehttp/guzzle/src/Client.php:182
/opt/drupal/web/core/tests/Drupal/Tests/DrupalTestBrowser.php:137
/opt/drupal/vendor/symfony/browser-kit/Client.php:404
/opt/drupal/vendor/symfony/browser-kit/Client.php:324
/opt/drupal/vendor/friends-of-behat/mink-browserkit-driver/src/BrowserKitDriver.php:719
/opt/drupal/vendor/friends-of-behat/mink-browserkit-driver/src/BrowserKitDriver.php:494
/opt/drupal/vendor/behat/mink/src/Element/NodeElement.php:153
/opt/drupal/vendor/behat/mink/src/Element/NodeElement.php:161
/opt/drupal/web/core/tests/Drupal/Tests/UiHelperTrait.php:100
/opt/drupal/web/core/tests/Drupal/Tests/UiHelperTrait.php:216
/home/runner/work/islandora/islandora/build_dir/tests/src/Functional/JsonldTypeAlterReactionTest.php:30
/opt/drupal/vendor/phpunit/phpunit/src/Framework/TestResult.php:726
ERRORS!
Tests: 21, Assertions: 340, Errors: 3.

What steps does it take to reproduce the issue?

  • When does this issue occur?

  • Which page does it occur on?

  • What happens?

  • To whom does it occur (anonymous visitor, editor, administrator)?

  • What did you expect to happen?

Which version of Islandora are you using?

Any related open or closed issues to this bug report?

Screenshots:

@whikloj
Copy link
Member

whikloj commented Jun 16, 2023

It seems like stomp-php/stomp-php may have been abandoned. There seem to be a tonne of forks out there now. We could switch to one of them like https://packagist.org/packages/invia-de/stomp-php which supports PHP 8.

Alternatively, we could rethink the entire Alpaca routing layer.

@adam-vessey
Copy link

adam-vessey commented Jun 21, 2023

Looks like stomp-php/stomp-php#174 was merged; however, doesn't appear to be a release minted with it yet. PHP 8.1-supporting release forthcoming?

@whikloj
Copy link
Member

whikloj commented Jun 21, 2023

Yeah somehow I ended up as a maintainer. I don't have a clear understanding of what their process is, but I'm going to try and push a 5.1.0 tag out shortly.

@rosiel
Copy link
Member Author

rosiel commented Jun 22, 2023

Thank you @whikloj!

@rosiel
Copy link
Member Author

rosiel commented Jun 23, 2023

Running on PHP 8.1 with stomp-php/stomp-php 5.1.0, I'm still getting the following errors, which are the same as the ones in this original ticket:

5) Drupal\Tests\islandora\Functional\EmitNodeEventTest::testEmitEvent
Exception: Deprecated function: Return type of Stomp\Transport\Frame::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
include()() (Line: 19)


/var/www/html/drupal/web/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:49
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:204
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:153
/var/www/html/drupal/vendor/guzzlehttp/promises/src/TaskQueue.php:48
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:248
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:224
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:269
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:226
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:62
/var/www/html/drupal/vendor/guzzlehttp/guzzle/src/Client.php:182
/var/www/html/drupal/web/core/tests/Drupal/Tests/DrupalTestBrowser.php:137
/var/www/html/drupal/vendor/symfony/browser-kit/Client.php:404
/var/www/html/drupal/vendor/symfony/browser-kit/Client.php:324
/var/www/html/drupal/vendor/friends-of-behat/mink-browserkit-driver/src/BrowserKitDriver.php:719
/var/www/html/drupal/vendor/friends-of-behat/mink-browserkit-driver/src/BrowserKitDriver.php:494
/var/www/html/drupal/vendor/behat/mink/src/Element/NodeElement.php:153
/var/www/html/drupal/vendor/behat/mink/src/Element/NodeElement.php:161
/var/www/html/drupal/web/core/tests/Drupal/Tests/UiHelperTrait.php:100
/var/www/html/drupal/web/modules/contrib/islandora/tests/src/Functional/IslandoraFunctionalTestBase.php:318
/var/www/html/drupal/web/modules/contrib/islandora/tests/src/Functional/EmitNodeEventTest.php:53
/var/www/html/drupal/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

6) Drupal\Tests\islandora\Functional\IslandoraSettingsFormTest::testJwtExpiry
Exception: Deprecated function: Return type of Stomp\States\Meta\SubscriptionList::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
include()() (Line: 23)


/var/www/html/drupal/web/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:49
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:204
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:153
/var/www/html/drupal/vendor/guzzlehttp/promises/src/TaskQueue.php:48
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:248
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:224
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:269
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:226
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:62
/var/www/html/drupal/vendor/guzzlehttp/guzzle/src/Client.php:182
/var/www/html/drupal/web/core/tests/Drupal/Tests/DrupalTestBrowser.php:137
/var/www/html/drupal/vendor/symfony/browser-kit/Client.php:404
/var/www/html/drupal/vendor/symfony/browser-kit/Client.php:324
/var/www/html/drupal/vendor/friends-of-behat/mink-browserkit-driver/src/BrowserKitDriver.php:719
/var/www/html/drupal/vendor/friends-of-behat/mink-browserkit-driver/src/BrowserKitDriver.php:494
/var/www/html/drupal/vendor/behat/mink/src/Element/NodeElement.php:153
/var/www/html/drupal/vendor/behat/mink/src/Element/NodeElement.php:161
/var/www/html/drupal/web/core/tests/Drupal/Tests/UiHelperTrait.php:100
/var/www/html/drupal/web/modules/contrib/islandora/tests/src/Functional/IslandoraSettingsFormTest.php:41
/var/www/html/drupal/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

7) Drupal\Tests\islandora\Functional\JsonldTypeAlterReactionTest::testMappingReaction
Exception: Deprecated function: mb_strtolower(): Passing null to parameter #1 ($string) of type string is deprecated
Drupal\Core\Config\Entity\Query\Condition->compile()() (Line: 39)


/var/www/html/drupal/web/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:49
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:204
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:153
/var/www/html/drupal/vendor/guzzlehttp/promises/src/TaskQueue.php:48
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:248
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:224
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:269
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:226
/var/www/html/drupal/vendor/guzzlehttp/promises/src/Promise.php:62
/var/www/html/drupal/vendor/guzzlehttp/guzzle/src/Client.php:182
/var/www/html/drupal/web/core/tests/Drupal/Tests/DrupalTestBrowser.php:137
/var/www/html/drupal/vendor/symfony/browser-kit/Client.php:404
/var/www/html/drupal/vendor/symfony/browser-kit/Client.php:324
/var/www/html/drupal/vendor/friends-of-behat/mink-browserkit-driver/src/BrowserKitDriver.php:719
/var/www/html/drupal/vendor/friends-of-behat/mink-browserkit-driver/src/BrowserKitDriver.php:494
/var/www/html/drupal/vendor/behat/mink/src/Element/NodeElement.php:153
/var/www/html/drupal/vendor/behat/mink/src/Element/NodeElement.php:161
/var/www/html/drupal/web/core/tests/Drupal/Tests/UiHelperTrait.php:100
/var/www/html/drupal/web/modules/contrib/islandora/tests/src/Functional/JsonldTypeAlterReactionTest.php:33
/var/www/html/drupal/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

ERRORS!
Tests: 70, Assertions: 898, Errors: 7, Skipped: 1.

@whikloj
Copy link
Member

whikloj commented Jun 23, 2023

Is this running somewhere I might be able to view the logs?

@rosiel
Copy link
Member Author

rosiel commented Jul 4, 2023

must have been a caching issue, it seems to be working now.

@rosiel rosiel closed this as completed Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants