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

ENH Update code to reflect changes in template layer #1499

Merged

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli marked this pull request as draft September 26, 2024 04:55
@GuySartorelli GuySartorelli force-pushed the pulls/3/refactor-template-layer branch 4 times, most recently from d02215a to 5711e1b Compare October 7, 2024 02:57
@GuySartorelli GuySartorelli changed the title ENH Improve type safety to support refactored template layer ENH Update code to reflect changes in template layer Oct 7, 2024
@GuySartorelli GuySartorelli force-pushed the pulls/3/refactor-template-layer branch from 5711e1b to 20fe9d5 Compare October 22, 2024 00:12
@GuySartorelli GuySartorelli marked this pull request as ready for review October 23, 2024 03:06
Comment on lines -713 to +714
'date_ago' => $version->dbObject('LastEdited')->Ago(),
'date_formatted' => $version->dbObject('LastEdited')->Nice(),
'date_ago' => $version->dbObject('LastEdited')?->Ago(),
'date_formatted' => $version->dbObject('LastEdited')?->Nice(),
Copy link
Member Author

Choose a reason for hiding this comment

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

dbObject() can return null

Comment on lines -1607 to +1609
$template = SSViewer::chooseTemplate($templates);
// Only render preview panel if a template specifically for the asset admin has been provided
if ($template) {
return $this->renderWith($template);
if ($this->getTemplateEngine()->hasTemplate($templates)) {
return $this->renderWith($templates);
Copy link
Member Author

Choose a reason for hiding this comment

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

Instead of getting a specific absolute path to a template, we just check if the engine configured for this controller is able to find a template.

@emteknetnz emteknetnz merged commit 445a97f into silverstripe:3 Oct 30, 2024
5 of 12 checks passed
@emteknetnz emteknetnz deleted the pulls/3/refactor-template-layer branch October 30, 2024 21:49
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

Successfully merging this pull request may close these issues.

2 participants