Skip to content

fix: replace deprecated and removed OC\Server getters#12547

Merged
ChristophWurst merged 1 commit intomainfrom
fix/ocp-server-getters
Mar 11, 2026
Merged

fix: replace deprecated and removed OC\Server getters#12547
ChristophWurst merged 1 commit intomainfrom
fix/ocp-server-getters

Conversation

@ChristophWurst
Copy link
Copy Markdown
Member

Fixes currently red CI like

1) OCA\Mail\Tests\Unit\Model\IMAPMessageTest::testIconvHtmlMessage
Error: Call to undefined method OC\Server::getSession()

/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/lib/Service/HtmlPurify/TransformURLScheme.php:124
/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/lib/Service/HtmlPurify/TransformURLScheme.php:66
/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIDefinition.php:104
/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php:92
/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php:95
/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/RemoveForeignElements.php:89
/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/Composite.php:24
/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php:209
/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/lib/Service/Html.php:146
/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/lib/Model/IMAPMessage.php:352
/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/tests/Unit/Model/IMAPMessageTest.php:85

2) OCA\Mail\Tests\Unit\Service\HtmlTest::testParseMailBody with data set #0 ('abc', null, 'abc')
Error: Call to undefined method OC\Server::getURLGenerator()

/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/tests/Unit/Service/HtmlTest.php:65

3) OCA\Mail\Tests\Unit\Service\HtmlTest::testParseMailBody with data set #1 ('abc', 'def', 'abc-- \r\ndef')
Error: Call to undefined method OC\Server::getURLGenerator()

/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/tests/Unit/Service/HtmlTest.php:65

4) OCA\Mail\Tests\Unit\Service\HtmlTest::testParseMailBody with data set #2 ('abc-- \r\ndef', 'ghi', 'abc-- \r\ndef-- \r\nghi')
Error: Call to undefined method OC\Server::getURLGenerator()

/home/runner/actions-runner/_work/mail/mail/nextcloud/apps/mail/tests/Unit/Service/HtmlTest.php:65

Changes made with Rector

@DerDreschner
Copy link
Copy Markdown
Contributor

Do you plan to change the psalm NullArgument errors as well? Or will that happen in a separate PR?

@ChristophWurst
Copy link
Copy Markdown
Member Author

I'm trying to silence Psalm. This is not a real issue. Unsure why it pops up now.

Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
@ChristophWurst ChristophWurst force-pushed the fix/ocp-server-getters branch from 2bf3b50 to e157960 Compare March 11, 2026 08:55
@ChristophWurst ChristophWurst merged commit 329472a into main Mar 11, 2026
53 of 58 checks passed
@ChristophWurst ChristophWurst deleted the fix/ocp-server-getters branch March 11, 2026 12:52
@ChristophWurst
Copy link
Copy Markdown
Member Author

/backport to stable5.7

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