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

TASK: servername auch im title tag im backend fragment ergänzt #132

Conversation

crydotsnake
Copy link
Contributor

Beschreibung / Description

Ergänzt denn Servernamen der Seite noch im Fragment für die Wartungsmodusmaske im Backend.

Copy link
Member

@alxndr-w alxndr-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier müsste man noch prüfen, ob YRewrite installiert ist und wenn ja, dann dessen Titel ausgeben.

Ist gerade bei Multidomain wichtig.

@crydotsnake crydotsnake requested a review from alxndr-w February 15, 2025 12:04
Copy link
Member

@alxndr-w alxndr-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ungetestet, lgtm

@skerbis skerbis removed their request for review February 15, 2025 15:26
<title>Maintenance</title>
<title>
<?php
if (rex_addon::get('yrewrite')->isAvailable() && rex_yrewrite::getCurrentDomain()->getName() !== '') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (rex_addon::get('yrewrite')->isAvailable() && rex_yrewrite::getCurrentDomain()->getName() !== '') {
if (rex_addon::get('yrewrite')->isAvailable() && rex_yrewrite::getCurrentDomain()->getName() !== null) {

@alxndr-w Wir hatten es Ja neulich im Slack darüber ob getName() auch Null zurückgeben kann. Dann würde es eventuell sinn machen, anstatt auf leer, auf null zu prüfen.

Wie siehst du das?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (rex_addon::get('yrewrite')->isAvailable() && rex_yrewrite::getCurrentDomain()->getName() !== '') {
if (rex_addon::get('yrewrite')->isAvailable() && rex_yrewrite::getCurrentDomain() !== null && rex_yrewrite::getCurrentDomain()->getName() !== '') {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oder so.. doppelt hält besser ;)

Copy link
Member

@alxndr-w alxndr-w Feb 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So meinte ich. Du musst sicherstellen, dass bei rex_yrewrite::getCurrentDomain() auch wirklich ein Objekt zurückkommt, bevor du die Methode ->getName() ausführen kannst.

Bzw. es gibt auch noch eine andere Schreibweise:
rex_yrewrite::getCurrentDomain()?->getName()
^

ich weiß nicht, ob die bereits in PHP 8.1 verfügbar ist. Hier könntest du mal recherchieren:

https://stitcher.io/blog/php-8-nullsafe-operator

Copy link
Contributor Author

@crydotsnake crydotsnake Feb 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kam wohl mit PHP 8.0 hinzu: https://php.watch/versions/8.0/null-safe-operator

Dann gibt es diese auch mit PHP 8.1 und Höher.

Co-authored-by: Alexander Walther <[email protected]>
@crydotsnake crydotsnake requested a review from alxndr-w February 22, 2025 12:33
@crydotsnake crydotsnake force-pushed the task/servername-auch-im-backend-fragment-title-tag-eingebunden branch from 7c3307e to aeae8a9 Compare February 22, 2025 12:37
Copy link
Member

@alxndr-w alxndr-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@alxndr-w alxndr-w merged commit 76e8114 into FriendsOfREDAXO:main Feb 22, 2025
1 check failed
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