-
Notifications
You must be signed in to change notification settings - Fork 105
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
MNT Fix unit test #621
MNT Fix unit test #621
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure this behaviour is correct, and isn't indicative of an unintended regression? When changing a test to match a change in behaviour I'd expect to see some explanation of why the behavioural change is correct.
The unit test is simply calling Hierachry::getTreeTitle() which has recently been updated public function getTreeTitle(): string
{
$owner = $this->getOwner();
$title = $owner->MenuTitle ?: $owner->Title;
$owner->extend('updateTreeTitle', $title);
return Convert::raw2xml($title ?? '');
} |
Right, I get that, but should I believe at the time I tested groups in |
8b2f7a2
to
5b09d61
Compare
Updated |
$title = Convert::raw2xml($title); | ||
$owner->extend('updateTreeTitle', $title); | ||
return $title; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the specific unit test rather than the underlying regression.
If updateTreeTitle
should permit HTML content, we should change where raw2xml()
is called in the method that calls it (in Hierarchy
) so that other updateTreeTitle
extension hooks can behave as expected
Closed in favour of silverstripe/silverstripe-framework#11517 |
Issue silverstripe/.github#349
Fixes https://github.com/silverstripe/silverstripe-subsites/actions/runs/12342588552/job/34442723479#step:12:109