Skip to content

Commit

Permalink
Revert 'Show a hint in the install tool if there are old custom templ…
Browse files Browse the repository at this point in the history
…ates (see #21)'
  • Loading branch information
leofeyer committed Sep 3, 2018
1 parent a7a459b commit add3f00
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 71 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## DEV

* Show a hint in the install tool if there are old custom templates (see #21).
* Make the ID of the subscription modules unique (see #40).

## 4.4.23 (2018-08-28)
Expand Down
58 changes: 0 additions & 58 deletions installation-bundle/src/Database/Version400Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,63 +220,5 @@ public function run()
WHERE
type = 'headline'
");

$this->checkCustomTemplates();
}

private function checkCustomTemplates()
{
static $mapper = [
'tl_article' => [
'mod_article_plain' => 'mod_article',
'mod_article_teaser' => 'mod_article',
],
'tl_content' => [
'ce_hyperlink_image' => 'ce_hyperlink',
],
'tl_module' => [
'mod_login_1cl' => 'mod_login',
'mod_login_2cl' => 'mod_login',
'mod_logout_1cl' => 'mod_login',
'mod_logout_2cl' => 'mod_login',
'mod_search_advanced' => 'mod_search',
'mod_search_simple' => 'mod_search',
'mod_eventmenu_year' => 'mod_eventmenu',
'mod_newsmenu_day' => 'mod_newsmenu',
'mod_newsmenu_year' => 'mod_newsmenu',
],
];

foreach ($mapper as $table => $templates) {
$stmt = $this->connection->prepare("
SELECT
*
FROM
$table
WHERE
customTpl = :template
");

foreach ($templates as $old => $new) {
$stmt->bindValue(':template', $old);
$stmt->execute();

if (false !== ($row = $stmt->fetch(\PDO::FETCH_OBJ))) {
$this->addMessage(sprintf('<li>%s.%s → %s</li>', $table, $row->id, $old));
}
}
}

if ($this->hasMessage()) {
$translator = $this->container->get('translator');

$this->prependMessage(sprintf(
'<h3>%s</h3><p>%s</p><ul>',
$translator->trans('old_templates'),
$translator->trans('old_templates_begin')
));

$this->addMessage(sprintf('</ul><p>%s</p>', $translator->trans('old_templates_end')));
}
}
}
12 changes: 0 additions & 12 deletions installation-bundle/src/Resources/translations/messages.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -302,18 +302,6 @@
<source>duplicate_subscriptions_end</source>
<target>The duplicate entries have been purged automatically. A backup of the original subscriptions has been stored in &lt;code&gt;tl_newsletter_recipients_backup&lt;/code&gt;.</target>
</trans-unit>
<trans-unit id="76">
<source>old_templates</source>
<target>Old templates in use</target>
</trans-unit>
<trans-unit id="77">
<source>old_templates_begin</source>
<target>The following elements are using old custom templates:</target>
</trans-unit>
<trans-unit id="78">
<source>old_templates_end</source>
<target>Check out the &lt;a href="https://github.com/contao/contao/blob/master/UPGRADE.md#template-name-changes" target="_blank" rel="noopener noreferrer"&gt;template name changes&lt;/a&gt; and update your installation accordingly.</target>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit add3f00

Please sign in to comment.