Skip to content

Commit

Permalink
fix false positive NoIndexNotificationField
Browse files Browse the repository at this point in the history
  • Loading branch information
lerni committed Nov 19, 2021
1 parent cbe71e8 commit 941444c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Extensions/IndexFormFileExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function updateFormFields(FieldList $fields, $controller, $formName, $con
{
$editorTab = $fields->findTab('Editor.Details');
$record = isset($context['Record']) ? $context['Record'] : null;
if ($editorTab && $record->NoFileIndex()) {
if ($editorTab && $record->NoFileIndex()->ID != 0) {
$message = _t('Kraftausdruck\Extensions\IndexFormFileExtension.NoindexNotification', 'Indexing disabled per parent folder ({parent})!', ['parent' => $record->NoFileIndex()->Title]);
$NoIndexNotificationField = LiteralField::create('X-Robots-Tag', '<p class="alert alert-warning">' . $message . '</p>');
$fields->insertBefore('Title', $NoIndexNotificationField);
Expand Down

0 comments on commit 941444c

Please sign in to comment.